MDM enrollment
Suggestions:
How do I reset a computer manually and/or not enrolled in MDM?
Enrolling in MDM allows you to reset a computer remotely. If the computer is not enrolled, it is obviously still possible to reset it manually.
MacOS
Consult This page Apple support to reset a MacBook.
This feature requires macOS Monterey or later and a MacBook with an Apple chip or Apple's T2 security chip.
Learn what to do if you cannot use the “Clear Contents and Settings” feature.
⚠️ Make sure no Apple ID is connected to avoid being blocked.
Windows 11
To reset your PC, go tostart > Settings > System > Recover. Next to Reset this PC, select Reboot the PC.
Select Keep my files, choose cloud or local, change your settings, then set Restore pre-installed apps? upon No.
More information on the site of microsoft.
Windows 10
If you have access to the user session, here is the tutorial from Microsoft to reset a computer running Windows 10 or 11.
On the other hand, if you are unable to open the user session (in case of a forgotten password for example), This tutorial explains how to force a Windows 10 computer to be reset:
“If you don't want to recover the data stored on your computer, you can then reset it. yourself. To start the procedure, turn on your computer and go to the login screen. Then, hold down the Shift key while selecting the On/Off icon. Reboot in the lower right corner of the screen. After rebooting, click on Troubleshoot and then select “Reset this computer.” All of your primary hard drive data, software, and settings will then be erased. Windows 10 will then start to be reinstalled. You will be invited to configure several pieces of information when it starts, including the password for your user account, which should not be forgotten!”