So you’ve decided to upgrade to the latest and greatest smartphone. Congratulations! Enjoy that fancy new selfie camera and perfectly uncracked screen. But if you’re selling your old phone in the process, you shouldn’t just hand it over without first taking a few security precautions.

Image Credit: Apple

Wired has a guide to wiping the data off your phone before selling it, and the process is pretty easy. First, you’ll want to make sure to back up or sync all your data.

On an iPhone, unpair any devices (like an Apple Watch) that you have connected to your phone, then sign out of iCloud in your settings. Just go to Settings, then click on your name in the first entry to get to the sign-out button. If you’re jumping the Apple ship and buying an Android phone, you’ll also want to turn off iMessage in your settings (under Messages) too. Then, all you have to do is clear your data. Under your settings, go to General, and all the way at the bottom you should see the button for Reset. Hit Erase All Content and Settings and you’re good to go.

If you’re wiping an Android, things are slightly different, but still quite basic. Make sure to save your apps to your account—hit the Account Sync button under settings and then Sync Now—and then back up your data to Google Drive by going into System > Back Up > Back Up to Google Drive. Then wipe your data by going back into System and hitting Reset. Go to Factory Data Reset, which will return your phone to its original state.

Once you follow those steps, you’ll all set to safely sell off your phone and rake in that sweet, sweet cash.

Via mentalfloss