How to remove your Apple Account and turn off Find My before selling your iPhone
Before your old iPhone goes to a new owner, it must be signed out of your Apple Account and fully erased. Otherwise the buyer hits Activation Lock and cannot use it.
Back up the iPhone, unpair your Apple Watch, then go to Settings > [your name] and sign out. Next, open Settings > General > Transfer or Reset iPhone > Erase All Content and Settings. Erasing a phone that had Find My on also removes Activation Lock, so the buyer can set it up as new.
1. Back up or transfer your data: Make a backup in iCloud or on a computer, or use Quick Start to move everything to your new iPhone. Do this first, because the later steps wipe the phone completely.
2. Do not delete things by hand: Resist the urge to delete photos, contacts or notes one by one while you are still signed in. Apple warns that this removes them from iCloud and from all your other devices too. The full erase later handles everything safely.
3. Unpair your Apple Watch: If an Apple Watch is paired with this iPhone, open the Watch app and unpair it before anything else. Unpairing also removes the watch's own Activation Lock.
4. Remove your cards from Wallet: Open the Wallet app, tap each card, then tap More (...) and choose Remove Card. A full erase also stops the cards from working, but removing them yourself gives you peace of mind.
5. Sign out of your Apple Account: Go to Settings, tap your name at the top, scroll down and tap Sign Out. Enter your Apple Account password when asked. This turns off Find My on the phone.
6. Erase the iPhone: Open Settings > General > Transfer or Reset iPhone > Erase All Content and Settings. Enter your passcode and confirm. If you use an eSIM, choose to delete the eSIM as well when the phone asks, since you are giving the phone away.
7. Check the hello screen: When the erase finishes, the iPhone restarts to the setup screen in different languages. That is how the buyer should receive it. Do not set it up again yourself.
8. Check your Apple Account device list: On another device or a browser, sign in to your Apple Account, open Devices and make sure the old iPhone is no longer listed. Remove it if it still shows.