To restrict web access for your enter site, you can place .htaccess file in public_html with the following directives in it:
allow from IP
deny from all
(where IP will need to be replaced with an actual IP address. You can have as many allow from IP lines as you like and the last line should be deny from all).
Example: You want to allow access to IP 220.127.116.11 and 18.104.22.168. These are just example IPs. And you want to deny access to everyone else. You can use FTP or File Manager in cPanel and create a text file with the name of .htaccess (please note the file name starts with a dot). The file will contain these three lines:
allow from 22.214.171.124
allow from 126.96.36.199
deny from all
That is all. Upload this file to public_html if you want to restrict access to entire site or if only a certain folder and files/folders under that certain folder then upload it under that. Say you want to restrict access to yourdomain.com/secret/ then you need to upload .htaccess file to public_html/secret/ folder.
The rules are read from top to bottom. If a request comes from first or second IP, they will get access. If a request to access the website comes from another IP, the third rule will match and will be denied access.
If you get Internal Server Error when you setup the rules, most probably something went wrong with file permission. The permission for .htaccess file should be 755.
Let us know if you need further assistance.