How Does a Website Work?
A website generally consists of a document written in HTML, which stands for Hyper Text Markup Language. The hyper text is of course the blue underlined links you can click on within a webpage that will take you to a related page.
An HTML file can be written with a simple word processor, such as Notepad, contained within Windows. This file needs to be named "index.html" and then placed on a computer somewhere called a "web host."
This can be your own computer, but more likely you will rent space on a computer owned by a web hosting company, sharing this computer with many other people, and host your HTML file there.
Every computer on the Internet has an address called an IP (Internet Protocol) address. It's a series of numbers, and can be typed into the address bar of a web browser to tell the browser to go check to see if that computer has an index.html file on it.
If it does, the index.html file will download into your browser, which then displays the HTML file as a webpage.
However, remembering IP addresses can be difficult and not conducive to creativity or branding, and so, we have the domain name system. This allows websites to have fanciful names, like yahoo.com, which are technically only nicknames for the IP address. Easier to remember.
So when you type in the domain name into your browser, the domain name server finds out what the actual IP address is, goes to that computer, and downloads the HTML file into your browser.