Tap Settings > General > Transfer or Reset [Device]
Then tap Erase All Content and Settings.
If asked, enter your passcode or Apple ID password
Then confirm that you want to erase your device. Forgot your passcode or Apple ID password?
Wait for your device to erase
Depending on your device, it can take a few minutes to completely erase your data.