Back up the iPhone to iCloud or a computer
Sign out of Apple ID and iCloud
Turn off Find My iPhone
Remove the device from your Apple ID account
Unpair Apple Watch if connected
Remove SIM card
Open Settings
Tap General
Tap Transfer or Reset iPhone
Tap Erase All Content and Settings
Enter passcode and Apple ID password if prompted
Confirm erase
Wait for the device to restart and erase
Set up as new or restore from backup
If selling or giving away, remove any remaining accessories and case
