If you don't already have the Raspberry Pi Imager software installed, you can download it for pretty much any operating system from the Raspberry Pi website. If you're running Linux, you can probably install it from your package manager, or you can install it as a Flatpak via Flathub.
Once installed, open the Raspberry Pi Imager software.
Click on Choose Device and then select the Raspberry Pi you want to install the operating system on.
Click on Choose OS and then select the operating system you want to install on your Raspberry Pi. If you're using a Raspberry Pi Zero, you should select the 32-bit version of Rasperry Pi OS Lite.
Click on Choose Storage and then select the microSD card that you want to install the operating system on.
Click Next and then Edit Settings to change the settings for the operating system you're installing.
On the General tab, you should enter the username and password of a non-root user that you want created during the installation process. You should also configure your Wi-Fi settings so that your Raspberry Pi can connect to the Internet.
On the Services tab, you should enable SSH so that you can connect to your Raspberry Pi remotely. After updating the settings, click Save.
You will now be asked if you want to apply the custom OS settings, click on Yes, and then Yes again when you're prompted to confirm that you want to write the operating system to the microSD card.
The Raspberry Pi Imager software will now write the operating system to the microSD card. Depending on the speed of your Raspberry Pi, microSD card, internet connection, etc., this process can take anywhere from a few minutes to half an hour.
Once the OS has finished writing to the microSD card, the software will then verify that the writing was successful.
Once the verification process is complete you will be presented with a message letting you know that the operating system has been written to the microSD card. Click Continue and you can then remove the microSD card from your computer.
You can now insert the microSD card into your Raspberry Pi and power it on. Depending on the hardware and OS you're using, the very first boot can take anywhere from 30 seconds to 5 minutes. Now might be a good time to make sure you can login to your router, as we'll need to do this during the next step.