htpasswd is a utility to create passwords for the users you want to access certain files/directories of your webserver. Then you create a .htaccess file in the directory you want to password-protect.
To protect just a file your .htaccess must be something like this:
AuthName "Whatever you want"
Require user username