Attention: you should make a backup of your iPhone data before sell it and do deletion so that you can keep these file on your new phone. There are three ways you can do a backup:
-iAny Manager (Recommended!)
When the backup is finished, you can start to erase iPhone data permanently. Write more bulk data like videos into your iPhone is a very simple but incomplete way, because the new data is possible to cover the deleted data but we cannot make sure all the deleted data can be overwritten. Therefore, you should follow the ways below.
Way 1: Delete iPhone data with iTunes
This way is to delete the backup file which contains the iPhone data. The process goes like this:
Open iTunes Preferences:
Windows users: Choose Edit > Preferences
Mac users: Choose iTunes > Preferences
Don’t connect iPhone with iTunes, on the Preferences tab, click “Devices”. Then iTunes will show the backup info for finding the backup.
Mark the backup file you need to deleted, and click “Delete Backup” button.
Way 2: Completely delete data from iPhone itself
Please follow these steps to clear all iPhone personal data.
1. Tap the Settings app from the Home screen of your iPhone
2. Then tap on General settings menu.
3. Tap on Reset menu item in the bottom.
4. Tap on Erase All Content and Settings.
5. And then you will be prompted to confirm your selection, tap on Erase iPhone. You can't undo this action, tap Erase iPhone one more time to confirm.
Also can follow this picture guide: