I strongly advise you to encrypt your phone's data before resetting it to factory settings. Deleting all the files does not actually delete them all, anyone with a spare hour or two can extract deleted information from the phone.
By encrypting your phone you make sure that even if he/she got the deleted data, the data would be useless.
To encrypt:
1. Go to "settings"
2. "General" (skip if old settings layout)
3. "Security encrypt device"
4. Make sure it is connected to a charging outlet
To reset
1. Go to "settings"
2. "General" (skip for old settings layout)
3. "Backup and Reset"
4. Uncheck "Automatic Restore"
5. "Factory data reset"
6. "Reset Device"
Done
P.S It is advised you encrypt your phone twice or more, but if you are an impatient person, you may encrypt it once, which should be enough. Not all Pre-Owned phone buyers are looking to extract data from your phone.