If the Mac you’re trying to reset is powered by Apple silicon you can use this tool. The same goes for any Intel Mac with an Apple T2 security chip, which is basically any Mac made after 2018.
If you have the latest MacBook with Apple Silicon processors, or an older MacBook Pro with Intel ... factory reset a Mac ...