macOS, delete profiles that need password
You can back up the Mac and then boot to recovery and erase it. The MDM profiles are designed to resist cracking so erase and restore is often the fastest method.

https://support.apple.com/en-us/HT204904