if you can afford it, don't sell or trade in your phone. 
Data recovery is a bitch and most mobile technicians harvest data as a side hustle. 
Another alternative can be gifting the device to a family member under the condition that they cannot sell it.