Raspberry Pi OS
sudo apt update
sudo apt full-upgrade
Configuration tool
sudo raspi-config
Add a WiFi network
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
add network details
network={
ssid="name"
psk="password"
}
and run
wpa_cli -i wlan0 reconfigure