What is "localhost"?

"localhost" is a special hostname, that, does not connect you to a website; instead, it connects you, as the name says, to yourself.
Here is an example:
If you have a web server listening on port 80 and you connect to http://localhost, you are connecting to your web server.
Another example:
If you instead have a web server listening on port 443 and you connect to https://localhost, you are always connecting to your web server.