You need to turn on your phone in recovery mode, you can do that by powering on the phone by holding power button + home button, keep them pressed until a yellow colored menu appears.
On that menu click on the Data/Factory reset option, and then click yes.
After it is done, select the reboot system option.
Use volume keys to navigate up/down, power button to go back and home button to select the option.
You will loose your messages, contacts, calender etc, and even apps. Bought apps can be downloaded again from the store without paying again, given you use the same google account to log in the store from which they were bought from. It will be just like it was fresh out of the box.