From within Settings, tap General.
Scroll to and tap Transfer or Reset iPhone.
Tap Reset.
Erase All Content and Settings - Choosing this will reset and remove your apps, data, and Apple ID, returning the device to factory settings.
From this screen, you can perform a variety of actions:
You've completed the steps!
