If you own the iPhone, use Recovery Mode with a computer
Connect the iPhone to a Mac or Windows PC
Open Finder on Mac or iTunes on Windows or older macOS
Put the iPhone into Recovery Mode
For iPhone 8 or later, quickly press and release Volume Up, quickly press and release Volume Down, then press and hold the Side button until the recovery screen appears
For iPhone 7 or 7 Plus, press and hold the Side button and Volume Down button until the recovery screen appears
For iPhone 6s or earlier, press and hold the Home button and the Side or Top button until the recovery screen appears
When prompted on the computer, choose Restore
Wait for the reset to finish
Set up the iPhone again
If Find My iPhone is enabled, sign in with the Apple ID after reset
If you forgot the Apple ID password, use Apple Account recovery at iforgot.apple.com
If you do not own the iPhone, do not attempt to reset it
If the iPhone is Activation Locked, only the Apple ID owner can remove it
Contact Apple Support or the previous owner if needed
