If you need to sell or give away an iPhone or iPad, you’ll need to completely wipe the device before you hand it off to a new owner so they can use it. With a factory reset, all private data gets wiped and the device acts as if it were new. Here’s how to do it.

Steps to Take Before Resetting

Before resetting your iPhone or iPad, make sure you have a backup of the device. You can backup your data using iCloud, Finder (on Mac), or iTunes (on Windows). Or you can transfer data directly between your old device and a new one using Quick Start.

After that, you’ll need to disable “Find My iPhone” or “Find My iPad.” This officially signs the device out of Apple’s “Find My” network that keeps track of your device’s location if it gets lost or stolen. To do so, open Settings and tap your Apple ID name. Then navigate to Find My > Find My (iPhone or iPad) and flip the switch beside “Find My iPhone” or “Find My iPad” to “Off.”

RELATED: What to Do Before Selling, Giving Away, or Trading Your iPhone

How to Erase All Content and Reset iPhone or iPad

To perform a factory reset, first open Settings on your iPhone or iPad.

In Settings, tap “General.”

In General, scroll down to the very bottom of the list and tap either “Transfer or Reset iPad” or “Transfer or Reset iPhone.”

In Transfer or Reset settings, you have two main choices. “Reset” opens a menu that allows you to reset certain preferences without losing any of your personal content stored on the device (such as Photos, messages, emails, or app data). That might be useful if you plan to keep using the device and just want to reset specific preferences.

But, if you’re going to give or sell the device to a new owner, you’ll want to completely wipe all of your personal data and settings on the device. To do that, tap “Erase All Content and Settings.”

On the next screen, tap “Continue.” Enter your device’s passcode or your Apple ID password if asked. After a few minutes, your device will erase itself completely. When it restarts, you’ll see a welcome setup screen identical to the one you’d see if you just got a new device.

Now that your iPhone or iPad has been wiped, it’s ready for you to give away—or sell it. Good luck!