If you are considering selling your iPhone or iPad, then you have to make sure that you securely erased all your personal data from it following very simple rules that we will explain here. Make sure you turn off “Find my iPhone” if you have it activated. You can do that easily through Settings>iCloud>Turn off the Find My iPhone option. Before you think about erasing your data you have to make sure that you have backed everything on iCloud or iTunes. Otherwise, you won’t be able to get your stuff back. Once you’re sure you have a backup for your own use, proceed on.
Once you complete the backup, go to General > Reset, then tap Erase All Content and Settings. This will completely erase your device and turn off iCloud, iMessage, FaceTime, Game Center, and other services. You will see an Apple logo and a progress bar during the data removal process. Once completed, all the data on your iPhone are erased.
Your iPhone or iPad will reboot after a few minutes and all your personal data should be gone and again look like the day you pulled it out of the box. When the device is turned on for the first time by the new owner, Setup Assistant will guide them through the setup process.
If you are using iCloud and Find My iPhone on the device, you can erase the device remotely and remove it from your account by signing in to icloud.com/find, selecting the device, and clicking Erase. When the device has been erased, click Remove from Account.