I am Vinod. I will try my best to help you resolve this issue.
If you want to erase everything from the phone, the easiest way would be to go into settings > general > reset > erase all contents and settings and during the setup, choose to set it up as a new phone.
Or you can use itunes in the computer to restore the iphone to factory settings. Open itunes in the computer and connect the iphone to the computer. Now, your iphone will be listed in itunes. Click on the iphone logo listed in itunes and now, to the middle of the screen, you will find a "restore iphone"button. Click on it to start the restore (after the restore, set it up as new).
Hope this helps. Let me know if you find any difficulty.
PS: If you iphone is not working properly, the above solutions may not work and we may have to force the iphone into recovery mode. So if your phone has issues, let me know and we can proceed accordingly.