Put the iPhone in Recovery Mode
Connect the iPhone to a Mac or PC
Open Finder on Mac or iTunes on Windows or older macOS
Select the iPhone when it appears
Choose Restore iPhone
Confirm the restore to erase the device
Wait for the process to complete
Set up the iPhone as new or restore from a backup
If Find My iPhone is enabled, erase it from iCloud.com using Find Devices
Sign in with the Apple ID linked to the iPhone
Select the iPhone
Choose Erase This Device
Confirm the erase action
