Mac OS installer on a flash drive

I had a spare MacBook Air that was running the Linux OS. My daughter suddenly needed a laptop to replace her recently broken one, and so I had to reinstall the Mac OS on the Air. I had difficulty figuring out how to do it until I came across this Apple website that explained how to create a bootable installer for MacOS on a flash drive. Now I have an emergency USB drive and I’m sure will come in handy again. — MF