In command line, execute it with following command line parameters: htpasswd.exe -c .htpasswd my_username, where my_username is username that will be used to authenticate
You will be prompted to enter and re-enter password. Password will be hashed by MD5 algorithm and save in the .htpasswd file
Upload .htpasswd file to the some folder outside Apache root folder, so it's not accessible from web
Using NotePad create .htaccess file that contains:
Where /home/my_dir/.htpasswd is the location of the .htpasswd (absolute file path) and my_username is same username used in .htpasswd file
Upload .htaccess file to the directory you wish to password protect and that's it, when accessing any file inside that directory, user will be prompted to enter username and password (once per session).
Note: this is very unsecure authentication method as password is sent as plain text via internet, so it is advisable to use other username and password then used for ftp/website administration.