The most convenient way to do a factory reset is via the phone settings.
1. Press HOME > MENU, and then tap Settings > SD card & phone storage > Factory data reset.
2. On the Factory data reset screen, tap Reset phone, and then tap Erase everything. Your phone will erase all personal data and restart. It may take a few minutes for the process to complete.
Performing a factory reset using phone buttons