Here's how you can download a free application that will block distracting websites on your Mac.
1. Go to the SelfControl app site.
2. Click on Download SelfControl.
3. Put the SelfControl app into your Applications folder.
Here's the official description:
"SelfControl is a free and open-source application for Mac OS X (10.5 or above) that lets you block your own access to distracting websites, your mail servers, or anything else on the Internet.
Just set a period of time to block for, add sites to your blacklist, and click "Start." Until that timer expires, you will be unable to access those sites--even if you restart your computer or delete the application."