Run in console on server. In the folder were you want the password file.
Change admin till a user name you like and press enter, you will need
after that to type a password twist.
htpasswd -c .htpasswd admin
Add to .htaccess
AuthUserFile /full/path/to/.htpasswdAuthType BasicAuthName "My Secret Folder" Require valid-user