Back up your iPhone to iCloud
Before you erase anything, make sure your photos, messages, and contacts are safe. Go to Settings → [Your Name] → iCloud → iCloud Backup and tap Back Up Now. Wait until the backup finishes — you’ll see the time and date update under "Last Successful Backup."
If you prefer a local backup, connect your iPhone to a Mac or PC and use Finder or iTunes.
Turn off Find My iPhone
Find My must be disabled before a buyer can activate the device. Go to Settings → [Your Name] → Find My → Find My iPhone and toggle it off. You’ll need to enter your Apple ID password to confirm.
If you skip this step, the next owner will see an Activation Lock screen and won’t be able to use the phone.
Sign out of iCloud & the App Store
Go to Settings → [Your Name] → Sign Out at the bottom. Enter your Apple ID password and tap Turn Off. Choose whether to keep a copy of your data on the device (it will be erased anyway, so either option is fine).
This removes your Apple ID, iCloud Drive, and App Store account from the device so the new owner can sign in freely.
Erase All Content and Settings
Now for the reset. Go to Settings → General → Transfer or Reset iPhone → Erase All Content and Settings. Tap Continue, enter your passcode if prompted, and confirm.
The iPhone will restart and display the "Hello" welcome screen. That means it’s fully wiped and ready for its new owner.