v4.0.2 for Mac OS X 10.10+
Users of older OS versions can download SelfControl 3.0.3 for Mac OS X 10.8+.
SelfControl is a free and open-source application for macOS 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 blocklist, 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.