.htaccess and .htpasswd

pls how do i do i add admin protection using htaccess and htpasswd

You can use “Directory Privacy” inside you Control Panel for simpler protection.

yeah i have used it but the prompt box is clashing with my root file instead of showing in admin folder it will first show on index page before showing on admin folder file

When you Alter Protection for your domain, you are provided with option to protect specific directory. Enter director’s name there and then setup user.
Remove protection for home directory.