Follow these steps to prepare your device for reset
Create a backup
Make sure you have a current backup of your important files.
Find out how to back up your Mac.
Sign out of iTunes in macOS Mojave or earlier
If you’re using macOS Mojave or earlier, open iTunes. From the menu bar at the top of the screen or iTunes window, choose Account > Authorisations > Deauthorise This Computer.
Then enter your Apple ID and password and click Deauthorise.
Sign out of iCloud
If you’re using macOS Catalina or later, choose Apple menu > System Preferences, then click Apple ID. Select Overview in the sidebar, then click Sign Out.
If you’re using macOS Mojave or earlier, choose Apple menu > System
Sign out of iMessage
If you’re using OS X Mountain Lion or later, open the Messages app, then choose Messages > Preferences from the menu bar. Click iMessage, then click Sign Out.
Reset NVRAM
If using a Mac with Apple silicon, you can skip this step.
Shut down your Mac, then turn it on and immediately press and hold these four keys together: Option, Command, P, and R. Release the keys after about 20 seconds. This clears user settings from memory and restores certain security features that might have been altered. Learn more about resetting NVRAM.
Unpair Bluetooth devices that you’re keeping.
To unpair a Bluetooth device, choose Apple menu > System Preferences, then click Bluetooth. Move your pointer to the device that you want to unpair and click the remove (x) button next to the device name. Go to Preferences, click iCloud, then click Sign Out.