In this tutorial you are going to learn how to wipe or remove all the data on iPhone and iPad.
Step # 1 – Start the Settings Application and go to General

Step # 2 – Scroll Down and Tap Reset

Step # 3 – Tap Erase All Content and Settings

You will be asked to input your passcode and restriction passcode.
Step # 4 – Tap Erase iPhone Twice

You will be asked to input your Apple ID password. This is to remove the device from Find My iPhone. Once the process is complete, you can set up as a new device, restore from a different backup or sell or give your device to someone without worries.