Wired has a guide describing How to Wipe Your Phone Before You Sell It,
Some companies, like Apple and Google will even let you trade in your old phone to get money towards their latest and greatest phones.
But before you get ahead of yourself, that phone’s full of top-secret messages and embarrassing selfies that you’d never want anyone to see. Good news, though! All that private info can be wiped away before you hand off your boring old phone to some stranger. Here’s how to do it.
I may be a touch paranoid, but I’ve never sold an old phone after getting a new one. Occasionally, I’ll pass an old phone of mine down on to one of my kids.
But if I’m not going to use it anymore or my kids are finished with a phone, I’m going to pay someone to physically shred it. I have very little faith in the ability to permanently wipe data from such a device, and the costs of making a mistake are much higher than the resale or trade-in value of the phone.
Every phone has an option to clear all the info and restore default settings
I have zero trust that those factory resets wipe data so that it is truly unrecoverable:
https://www.gihosoft.com/android-recovery/recover-data-after-factory-reset-android.html