With the current device penetration of smartphones and tablets, it seems like everyone has a tiny computer in their hands at all times. And with new models being manufactured and service providers enticing new customers with the latest upgrades, there are a lot of devices that get left behind and are no longer in use. So what happens to those devices when the owner upgrades?

Thanks to public service campaigns, most customers know not to throw them away. The batteries and the circuitry are made of very dangerous materials that should never be allowed in a landfill. A lot of users choose to keep those devices in a drawer somewhere in case their new device breaks, in order to avoid the unexpected expense of paying out of pocket for a brand-new one. And thanks to charities that take donations of old devices or even offer payment for them, most devices don’t just end up in the garbage.

But whether you store it, donate it, sell it, give it to a friend or family member, or any other means of removing it from your immediate possession, you have to remember a few key guidelines for keeping your identity and your data safe.

Keep your friends secure – Before you make the change to your new device, you’ll want to save any text messages that you want to keep and backup your contacts list. Then, once those are saved and ported over to your new phone via the SIM card or through a side-load to your computer, you’ll need to delete that content. Anyone who gets your phone after you’re done with it would otherwise be able to call up those numbers, messages, any sent photos, and more.

Apps and folders – The same is largely true for apps and stored folders on your phone, especially if you used social media or a file storage service like Dropbox. If those apps are still there and logged in, the next person to come along could potentially access those accounts and even make changes to them.

What’s hiding in there? – Your phone has internal storage, just like a computer, and the best way to make sure you’ve found everything is to connect the phone to your computer via its cable and open it on your screen. It’s as simple as treating your phone like a disc or a flash drive; just click on it to open and check the folders that appear. If you find any pictures, documents, or stored information, you can move it out of the phone and straight to your computer simply by dragging and dropping it. Just make sure you aren’t making a copy of the content instead of actually moving it, otherwise you’re leaving the original behind.

Once you’re sure you have all the information you need, it’s important to do a factory reset to restore the phone to its original “empty” status. When you’re done, it should look and act like it did the day you took it out of the box. That way, the next person to use or find the device will be the new user instead of picking up where you left off.