Go to Settings than look for "Back up & Reset". That should give you the option to reset your phone to factory settings.
What's the brand and model of your phone? Have you checked the website of the phone? It must have manuals for performing a factory reset.