If you plan on selling your iPhone, iPad or iPod Touch or simply give it to someone else, the first logical step would be to wipe all personal data like contacts, messages, photos and videos, and re-install it as new.
Before everything else you can perform a backup (if you’re only doing this to start afresh and not to sell or give your device to another person) so you can restore it later. iCloud does perform automated backups overnight, while your phone is charging or plugged in. Alternatively, you can manually backup your device, to ensure it contains even the latest data.
I’m not going to get into specifics on the matter, because my colleague Adam already explained all the steps you need to go through in order to backup your iPhone in another guide (read it here) – just follow the first part and your phone will be backed up in no time.
Now you can proceed to erase all existing data from your device. To do so, navigate to Settings -> General -> Reset and tap on “Erase All Content and Settings”.
On the next screen, enter your passcode and tap on the “Erase iPhone” option to confirm you want to delete all the content on your phone. You’ll be guided through a new setup and be offered the possibility to restore a backup ( the “Restore from iCloud Backup” option).
Note: The process of wiping data is the same on iPad and iPod Touch, but also on the Apple Watch. Also, it may take if you’re doing this on an iPhone 3G or older model or an iPod Touch (2nd gen or earlier model).
Alternatively, you can erase data from your iDevice via iTunes, altough this will also delete the current OS and install the latest build. Before you do so, you need to toggle off the “Find My iPhone” function which you can find in the iCloud pane of the Settings menu (disabling the option will require entering your Apple ID password).
Then, connect your iOS device to your computer, open iTunes and choose your device from the top bar. Select “Restore iPhone/iPad/iPod” and your device will be reverted to factory settings and all personal data will be erased. After you confirm your choice, the latest iOS build will begin to download and install on your phone.