Go to Settings. Tap Backup & reset. Tap Factory data reset. Tap Reset phone, and then tap Erase everything.