This is very easy to do using htaccess and can be useful if there is a spammer or disgruntled member attacking your site (something which unfortunately happens a lot to forum and blog owners).
To ban someone completely all you need to do is add the following code to your .htaccess file.
Simply replace the ip address below with the ip of the person you want to ban
#ban users from visiting the site order allow,deny deny from 18.104.22.168 allow from all
If you want to ban more people you simply add more lines, like this :
#ban users from visiting the site order allow,deny deny from 22.214.171.124 deny from 9126.96.36.199 deny from 188.8.131.526 allow from all