Back up any important data you want to keep
Remove your Samsung account and Google account from the phone
Turn off Find My Mobile and Factory Reset Protection if possible
Open Settings
Tap General management
Tap Reset
Tap Factory data reset
Review the items that will be erased
Tap Reset
Enter your PIN, password, or pattern if prompted
Tap Delete all
Wait for the phone to erase and restart
If the phone is locked or inaccessible, use Samsung Find My Mobile or Google Find My Device to erase it remotely
If you are selling or giving it away, remove the SIM card and microSD card before handing it over
