-
Download the latest Raspbian. Get the "lite" image if you don't require a GUI.
-
Burn the image to your SD card as you normally would depending on your OS. Etcher is a good tool for all systems.
-
Open the boot volume in finder and create a new file called "wpa_supplicant.conf".
-
Write your network config like this: (That's for WPA2 Personal with AES)
network={
ssid="YOUR_SSID"