Set a firmware password on your Mac - Apple Support
Set a firmware password on your Mac
When you set a firmware password on your Intel-based Mac, users who don't have the password can't start up from macOS Recovery or any disk other than the designated startup disk.
This feature requires a Mac with an Intel processor. For the equivalent level of security on a Mac with Apple silicon, simply turn on FileVault. If the Mac is managed by MDM (mobile device management), the MDM administrator can also remotely lock the Mac.
After your Mac finishes starting up from Recovery, choose Startup Security Utility (or Firmware Password Utility) from Utilities menu at the top of the screen.
Click Turn Off Firmware Password, then enter the firmware password again.
Quit the utility, then choose Restart from the Apple menu .
If you forgot the firmware password
If you can't remember your firmware password, get your Mac ready for service and schedule an in-person service appointment with an Apple Store or Apple Authorized Service Provider. Bring your Mac and its original receipt or invoice as proof of purchase.