About to buy the latest Samsung phone or save a bit of money on a Google Pixel 4A? Whether you plan to trade in your old Android phone for a discount on your new phone, sell it on eBay, give it away to a friend, or drop it off for recycling, you’re going to want to wipe it of all your data first by resetting it to factory conditions. Luckily, that’s pretty easy to do.

Before you start, be aware that these instructions were originally meant for a Pixel 3 XL running Android 9, and were recently checked on an original Pixel running Android 10. But the process for most current Android phones should be pretty much the same. Needless to say, first make sure that all of your data is transferred to your new phone, backed up, or both. Once your old phone has reset, there’s no going back.

Grid View The “Reset options” screen gives you three choices.

You’ll be reminded of that you’re wiping all your data, and removing your accounts from the phone.

Are you sure this is what you want to do? Absolutely sure?

Go to Settings

Select System > Advanced > Reset options

You will be presented with three choices. “Reset Wi-Fi, mobile & Bluetooth” is sometimes useful if you’re having trouble with connectivity. “Reset app preferences” will restore all of your app and notification defaults, among other things. Neither of these will delete the data on your phone. That’s the job of the third choice, “Erase all data (factory reset),” and that’s the one you’re going to select.

You’ll get a warning screen reminding you that your data will be erased, along with all the accounts you’re currently signed into. Select “Reset phone.”

If you have a PIN or some other security setup, you’ll be asked to enter it

You’ll get another screen asking if you’re sure this is what you want to do. Are you sure? Then hit the “Erase everything” button.

That’s it! The process usually takes only two or three minutes. Your phone will reboot and begin with the usual opening questions, such as language, account, network, etc. Once you see those, you’ll know that it’s worked.

There are a few things to be aware of. First, if you’ve got a Samsung phone, you’re going to be asked for your Samsung account password before you can reset (provided you’ve created one and added it to the phone).

If you’ve got an Android phone that is using an earlier version of the OS (say, before version 8), the reset may, after it reboots, ask for your login. This could be awkward if you’ve already sent the phone to someone else. As a result, if you’ve got an older phone, it’s a good idea to turn off your screen lock (by going to Security > Screen lock and selecting “None”) and deleting your Google account (which you’ll find at Settings > Account > Google) before you start the reset.

There is evidence that some data may remain on a phone even after it’s been reset. To be extra careful, you can encrypt the phone before resetting it:

Go to Settings > Security > Advanced > Encryption & credentials and select “Encrypt phone”

Go back to Settings and start the reset process

Of course, if you want to be really sure, and you don’t intend to give the phone to anyone, you could always grab a hammer.

Update September 3rd, 2020, 10:50AM ET: This article was originally published on May 22nd, 2019, and has been updated to mention more recent phones and to update a menu selection.