Use iCloud Find My if it is enabled
Go to iCloud.com/find on another device
Sign in with the Apple ID linked to the iPhone
Select the iPhone from All Devices
Choose Erase iPhone
Confirm the erase
Use Recovery Mode with a computer
Connect the iPhone to a Mac or PC
Put the iPhone into Recovery Mode
Open Finder on Mac or iTunes on Windows or older macOS
Select the iPhone when it appears
Choose Restore
Wait for the erase and reinstall process to finish
Use the Find My app on another Apple device
Open the Find My app
Sign in with the same Apple ID
Select the iPhone
Tap Erase This Device
Confirm the erase
Use Apple Configurator on a Mac if available
Connect the iPhone to the Mac
Open Apple Configurator
Select the iPhone
Choose Restore
Confirm the action
If Activation Lock is enabled, keep the Apple ID and password ready after erasing
