A factory reset of your iPhone erases all of your content and settings, reverting it to a like-new state. However, there are a few extra steps you should take if you plan to get rid of your iPhone.

What Does a Factory Reset Do?

As the name implies, a factory reset wipes everything from your phone and takes it back to the way it was when you first got it—you know, like it’s straight from the factory. It erases all your photos, apps, accounts, videos—nothing will be left. A factory reset takes several minutes to complete. Once it’s done, you’ll be prompted to set up your iPhone like it’s new.

What a factory reset does not do is completely reinstall your iPhone’s software from scratch. If you’re troubleshooting your device and a factory reset doesn’t solve the problem, you can try reinstalling your iPhone’s operating system.

If you plan to sell your phone or change platforms, though, there are a couple of other things you should do in addition to a factory reset.

Disable Find My iPhone

If you’re resetting your device because you want to sell it or give it away, it’s essential to turn off “Find My iPhone.” As of iOS 7, “Find My iPhone” also serves as an activation lock. This means if “Find My iPhone” is on, only you can set up the phone again. Fortunately, turning it off is easy.

Open the Settings app and tap your name at the top.

Tap iCloud > Find My iPhone.

Turn off the toggle, enter your Apple ID password when prompted, and then tap “Turn Off.”

There’s an extra step if you’re switching platforms (from iOS to Android)—you’ll need to deregister iMessage, too.

If You’re Switching Platforms, Deregister iMessage

When an iPhone user sends a message to another iPhone user, Apple defaults to iMessage. If you’re switching to Android and you don’t deregister your phone number from iMessage, the sending iPhone will still think you have an iPhone. Your messages will end up in the “iMessage Abyss” instead of being converted to SMS/MMS and sent to the Android phone.

To deregister iMessage, open the Settings app, scroll down, and then tap “Messages.”

Tap the toggle next to “iMessage” to turn it off.

Your phone number is now deregistered from iMessage, and you can continue to the factory reset. If you missed this step before getting rid of your iPhone, no worries. You can head over to Apple’s self-help support site and submit your phone number to be deregistered. You’ll be sent a free text message with a confirmation code. Enter the code, and you’ll be good to go.

With those things out of the way, you’re ready to reset your phone.

Perform a Full Factory Reset

When you’re ready to reset the device, open the Settings app and then tap “General.”

Scroll to the bottom, and tap Reset > Erase All Content and Settings.

If you have a passcode, you’ll be prompted to type it. Do so, and then tap “Erase iPhone.”

Tap “Erase iPhone” a second time.

That’s it! Your phone will process for several minutes. Once it comes back up, it’ll prompt you to set up your iPhone like new.