Back up your iPhone
Open Settings
Tap General
Tap Transfer or Reset iPhone
Tap Erase All Content and Settings
Enter your passcode
Enter your Apple ID password if prompted
Confirm the erase
Wait for the iPhone to restart
Follow the on-screen setup steps
Restore from iCloud backup or computer backup if needed
