See if you can access Internet Recovery Mode using Command + Option + R (Intel Mac only).
You can also try creating & using a bootable macOS USB installer (with a 2018+ Mac you will need to first modify the security settings by allowing booting from an external drive by using the Startup Security Utility...however, if the internal SSD has been erased, then this won't be an option):
Create a bootable installer for macOS - Apple Support
If you have a 2018+ model and access to another Mac, then you can perform a firmware "Restore". With an Apple Silicon Mac this will also push a clean copy of macOS onto the internal SSD, but with an Intel Mac you likely will then need to access Internet Recovery Mode to reinstall macOS.
Revive or restore an Intel-based Mac using Apple Configurator - Apple Support
Revive or restore a Mac with Apple silicon using Apple Configurator - Apple Support
FYI, you should always post the exact model of the Mac when asking for assistance since for many support issues this information is usually needed. You can get this information by clicking the Apple menu and selecting "About This Mac" or if the Mac cannot be booted, then by entering the system serial number here:
Check Your Service and Support Coverage - Apple Support