Performing a factory data reset can be useful. Maybe you’re going to sell your phone or send it back in for warranty work. It’s simple to do. Here’s how. Go to Settings. then Privacy, then Factory data reset. It will ask you to confirm that you really want to do it. After you confirm it there’s no turning back. Once it’s done it’s done.
Where the Factory data reset button appears may vary slightly from one manufacturer to another. These instructions should work for a vanilla build of Android, such as the Nexus S, but you may have to investigate the settings a bit to find it on a phone with a manufacturer skin. The rest of the process will be the same.
Also not that some phones (Motorola, particularly) also give you the option to wipe any extra internal storage as well as the storage card.