With the modern rpi-imager
tool, we can automate the imaging process for the Raspberry Pi computer board and make the process extremely painless for us each time we need to re-image.
The official Raspberry Pi's rpi-imager's tool (which can be installed from https://www.raspberrypi.com/software/) contains a command-line option that's not widely documented anywhere at the time of this writing (v1.7.5 was the latest release).
The best official documentation I can possibly find on Raspberry Pi Imager did not cover the command-line option.
As a result, I'll only cover the command-line option for macOS here as it's my daily driver.