If you are selling your phone, you must perform a Factory Reset to delete all of your personal information from the device prior to sale.
Factory Reset your Android Phone
Go to your phone’s Settings, then navigate to System > Reset options and select Erase all data (factory reset); you will usually need to confirm your choice and enter your password or PIN before the reset begins.
Factory Reset your iPhone
Open Settings
Tap General
Tap Transfer or Reset iPhone
Tap Erase All Content and Settings
Enter your passcode or Apple ID and password
Tap Continue
Follow the prompts
Tap Erase iPhone