Start by downloading the latest Raspbian from: raspberrypi.org.
Copy the image to the SD-card:
dd bs=4M if=2017-07-05-raspbian-jessie.img of=/dev/sdX conv=fsync
Mount the SD-card and add the wireless configuration file named wpa_supplicant.conf
to the root of the boot partition: