To prepare your device for sale you need to:
Unbind your Watch or AirPods from it, if you have ones.
Backup the data stored in your device to the Cloud or your PC.
Sign out from your user accounts in all of the apps on the device.
Turn off the "Find my iPhone" feature.
Clean your device of all the data and settings stored.
Unregister the device from your list of trusted devices.
Deactivate your iPhone (CDMA network) - or Remove the SIM if you're on GSM.
You could Unlock your device, but that's a tad bit difficult to do.