Tap Settings, then General. Scroll down until you see Reset. ...
Tap Erase All Content and Settings. ...
Now you will have to enter your Apple ID password. ...
The reset process can take a minute or two, after which you'll see the welcome screen asking you to swipe to continue.