Back up your iPhone to iCloud or your computer
On iPhone, go to Settings
Tap General
Tap Transfer or Reset iPhone
Tap Erase All Content and Settings
If prompted, enter your passcode
If prompted, enter your Apple ID password
Tap Erase Now
Wait for the reset to complete and the iPhone to restart
Follow the on-screen setup steps to set up the iPhone again
