There are lots of applications/softwares available which allows you to prevent access to websites from your computer. But if you do not want to spend any money, then you can do it manually by using the following procedure:
Go to C:\Windows\system32\drivers\etc …