First you need to log to your computer as an administrator for do this. Otherwise you can log to a user account which is making as an administrator. In Windows 7, there's an option called "Run as Administrator". Then follow the following path.
C > Windows > System 32 > drivers > etc
Now open the hosts file using a note pad which is inside in the etc folder. Now you can see the followings.
# Copyright (c) 1993-1999 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
# 188.8.131.52 rhino.acme.com # source server
# 184.108.40.206 x.acme.com # x client host
Now sites you want to block as a sentence below the localhost line and type the website which you want to block. Look at the following example.
E.g.: 127.0.0.2 www.****.com
E.g.: 127.0.0.2. www.yahoo.com
If you want to block another website then type is as below.
Like that you can type many number of websites which you want to block
by using the following format again and again.
127.0.0.6, 7, 8, 9, 10…….
Now save this file. But if you not log as an administrator you cannot save the new changes to the file. In Windows 7, you can open the hosts file by right clicking and "Run as Administrator" command.
Also you can unblock the blocked websites using the same way backward. You just have to do is log to the computer as an administrator and erase the line of the blocked website by opening the hosts file with a note pad.
Do this simple trick and enjoy and learn.