First, on terminal from the Raspberry Pi, type this command to install the required package.
dpkg -l firmaware-realtek

Next the dongle should be recognized by raspbian.
lsmod
lsusb

Next, the usb wi-fi adapter can be utilized to scan for a wireless network, and take note of the ESSID you want to connect.
iwlist wlan0 scan

If you using a network with WPA encryption, you’ll have to generate the passphrase with the following command, replace the SSID and the PASSWORD parameters from the network you want to connect. This will generate the hash, that you’ll need in the next step.
wpa-passphrase [ESSID] [PASSWORD]