Put the iPhone into Recovery Mode
Connect the iPhone to a Mac or PC
Open Finder on macOS Catalina or later
Open iTunes on Windows or older macOS versions
Select the iPhone when it appears
Choose Restore iPhone
Confirm the restore
Wait for the erase and reinstall process to finish
Set up the iPhone as new or restore from a backup
If Find My iPhone is enabled, erase it from iCloud.com using the Apple ID linked to the device
If Activation Lock appears after erasing, enter the Apple ID and password previously used on the iPhone
