Here are easy steps to do that:
- Back up your device on iCloud or iTunes. Otherwise, you won’t be able to get your stuff back.
- Make sure you turn off “Find my iPhone” if you have it activated. Go to Settings>iCloud> and turn off the Find My iPhone option.
- 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 device is erased.
- Your iPhone or iPad will reboot after a few minutes and all your personal data should be gone. The device will look like it did 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.