Due to the iPhone's multimedia capabilities and comprehensive array of applications, it is likely that some of your sensitive data, such as bank or email account details, are stored on the phone. If you are upgrading to a new iPhone and selling your old iPhone or giving it to someone as a gift, it is highly recommended that you erase all the data from your iPhone first. Erasing your iPhone can only be completed through an iTunes account and requires a small number of processes thanks to the iTunes interface.
Open iTunes on your computer and attach your iPhone using the USB cable provided.
Wait for the iPhone's icon to appear in the iTunes interface "Devices" category and click on the icon to open your iPhone's summary menu.
Select "Settings" from the main menu on the iPhone, then "General," "Reset" and "Erase All Content and Settings" from the subsequent menus.
Select "Yes" when asked to confirm that you wish to erase all content and settings.
Ensure that your iPhone is fully charged before beginning this process. If your iPhone runs out of battery before it has been fully erased, charge the phone and repeat the entire process.
This process may take several hours.