1. Sign out of iCloud, iTunes and App Store.
  2. If you’re switching to a non-Apple phone, deregister iMessage.
  3. Tap “General” -> “Transfer or Reset [device]” > “Erase All Content and Settings”