How to set up WiFi on a Raspberry Pi

Although the Raspberry Pi comes only with an Ethernet port, it can also connect to WiFi. All it needs is a WiFi USB dongle and some simple configurations.