How to create a bootable installer for macOS - Apple Support
Read the full article first. Do all of what applies to you, don't skip any steps and be aware this article has links at the bottom that will complete the process. One caveat on the bootable flash drive ....
To easily make a bootable installer, get the app "Install Disk Creator". It's safe and free. It's kind of slow but it does work well. If it were me, I'd create a pair of flash drives (16GB minimum) for security.
Once you have the flash drive, you boot from it (Option key at startup) and follow the screen prompts to install the OS. Being a new Mac, you'll need to get Monterey from the App Store. Download it but use Command Q to halt the installation on that Mac. I assume you're going to use the old Mac for this.
Use the old Mac to create the bootable flash drives too.
History lesson ... first time I did this I messed it up several times. But the. thing is, you can always start over so no matter how many times I messed up I got it right. I guess I wasted two hours tops.
From a cold start, startup and immediately press and hold the Option key to find the bootable drives. Choose the one that says Install OS or something like that.
Maybe 40 minutes or so to complete. Maybe a lot quicker with your power. :)