Open Settings
Tap General
Tap Transfer or Reset iPhone
Tap Erase All Content and Settings
Enter your passcode if prompted
Enter your Apple ID password if prompted
Confirm Erase iPhone
Wait for the reset to complete
Set up your iPhone again or restore from a backup
