I happen to know this. Follow the steps below to erase your Mac with Mac OS X Recovery Assistant:
Warning: Recovery Assistant performs a full erase, which removes everything on your Mac, including files, apps, user data, settings, and the OS itself.
Supported devices: Any Mac running macOS Catalina or later
- Boot into Mac Recovery Mode.
Intel-based Macs: Power off the Mac, turn it on, then immediately press and hold Command-R until the Apple logo and a progress bar appear.
Apple Silicon Macs: Turn off the Mac, press and hold the power button until you see a message reading “Loading startup options,” then choose Options > Continue.
- On the top-left corner, select Recovery Assistant > Erase Mac.
- Follow the instructions to erase your Mac and reinstall macOS.
There are also other ways to reset your Mac without a password. If the steps above don’t work, check out this guide: How to Factory Reset MacBook Pro/Air without Password or Apple ID?