Chances are your web space provider gives you a control panel like Cpanel which has htaccess built into it. So all you have to is select the folder you want protection on and the password and it makes the htaccess file for you.
"Chances are your web space provider gives you a control panel like Cpanel which has htaccess built into it. So all you have to is select the folder you want protection on and the password and it makes the htaccess file for you."
htaccess is for a lot more than just basic authentication, although in general it's better practice to use a Directory directive in the main config file if you are able. It makes it easier to figure out which directories have which special directives applied to them.