Back up your iPhone to iCloud or a computer
Turn off Find My iPhone
Sign out of iCloud and Apple ID
Sign out of iMessage and FaceTime
Unpair Apple Watch if you have one
Remove SIM card if needed
Go to Settings
Tap General
Tap Transfer or Reset iPhone
Tap Erase All Content and Settings
Enter your passcode and Apple ID password if prompted
Confirm the erase
Wait for the iPhone to restart to the setup screen
Remove the device from your Apple account at appleid.apple.com if needed
