The easiest way is using Internet recovery which is built in. But you can encounter issue’s if you are using a blade PCIe/NVMe SSD. As the macOS by default won’t be the needed version, this is where an external bootable OS installer drive can be better using a second Mac.
To install via Internet recovery [https://support.apple.com/en-us/102655|How to reinstall macOS]
To create a bootable OS installer, format a 32GB Thumb drive from a Mac to GUID and a Journaled fie system. Then copy to it the OS installer onto it from here [https://support.apple.com/en-us/102662|How to download and install macOS] then follow this guide to convert it [https://support.apple.com/en-us/101578|Create a bootable installer for macOS]