A quick bit of background;
The hosts file is a computer file used by an operating system to map hostnames to IP addresses. The hosts file is a plain text file, and is conventionally named "hosts". Basically when your browser looks for a web address it will normally look generally at the internet. However if you want to look on a specifc server and not the Internet, then you can do so by updating the hosts file.
When developing new websites it's sometimes impractical to develop under the live domain name so we make a domain available on just one server. Entering the domain and server address into your hosts file will enable you to access the website through any browser on that PC. A line in a hosts files looks like:
The easiest way to learn is to watch this video: