If you are using a computer using Apache, there are two files to use .htaccess and .htpasswd ->
.htaccess
AuthUserFile "path to .htaccess and .htpasswd"/.htpasswd
AuthName PasswordArea
AuthType Basic
require valid-user
.htpasswd
username:password
In the case that you are not running the server, put these two files in the directory(s) you want protected. You have to change the first line in the .htacces to conform to your directory in each instance. The .htpasswd part you need to have just a normal username, but the password needs to be in the cool *nix style. Using something like this web page
http://spectrum.troyst.edu/password/ . When working properly, the person should recieve a prompt to have a login and password. There are even changes that you can make to protect an individual file if wanted. Help can be found at the Apache website.