If you want to password protect a folder you can do it directly from cPanel. Login and then click on "directory privacy" in the files section
You will see a list of all the folders on your account. You can click on the icon to see the content of a folder, or clieck on the folder name to select it.
Check "Password protect this directory", give it a name and then click on "Save"
Once done create a user for that folder, adding the username end the password, then click on "Save". You can use the password generator for a secure password.