Reset to Factory Settings -

 

iPhone

Settings > General > Reset > Erase all contents & settings

 

Android

Sign out of any email accounts - in particular, any Gmail accounts.

Then, go to - Settings > Backup & Reset > Factory Data Reset

If you can't access your settings, you will need to reset your device in Recovery Mode - click here for instructions.