Use Recovery Mode with a computer
Connect the iPhone to a Mac or PC
Open Finder on Mac or iTunes on Windows or older macOS
Force restart the iPhone to enter Recovery Mode
When prompted, choose Restore
Wait for the erase and reinstall process to finish
Set up the iPhone as new or restore from a backup
Use iCloud Find My if the device is linked to your Apple ID
Sign in to iCloud.com on another device
Open Find Devices
Select the iPhone
Choose Erase This Device
Confirm the erase
Use Apple Support if you cannot access the Apple ID or computer
Provide proof of purchase if required
