How can I reset this iPhone..?

So, about a year ago my friend found an iPhone. He never touched it or anything, so he gave me it. Now I need to get all the stuff off it from the guy who actually had the phone. How do I go about resetting it besides trying go guess the password once every hour? It also says there's an error whenever trying to get on facebook or download the youtube app. It says "The certificate for this server is invalid" and that it could put my confidental information at risk. I really need to get it reset so I know whether I should replace the cracked screen or not.

iTunes has a reset button, have you tried that?

Yeah I didn't have access to it at the time. I got ahold of the original guy who had it and he'll give me 100$ for his 2 year old iPhone 4 with a cracked up screen, pretty cool.

If you want to completely wipe it, make it go into the a bit tricky DFU mode by following these instructions: 

  • Connect the iPhone to your computer and launch iTunes
  • Turn the iPhone off (hold down the power button at the top of the iPhone)
  • Hold down the sleep/power button and home button together for about 10 seconds, then release the power button. (Make sure you don't hard-restart it. It will do so after holding the power and home button for about 15 seconds) 
  • Continue to hold down the Home button until you hear the "USB connected" sound in Windows and a message appears in iTunes telling you an iPhone in recover mode has been detected.

Remember that the screen on the iPhone will be completely black when it is in DFU mode.

Afterwards download a update from Apple. I'd recommend 5.1.1 as that one has untethered jailbreak compatibility. If the phone is already over 6.0 don't bother, just download the latest update as downgrading an iPhone is just a hassle. When you've downloaded the update of your choice, hold shift and click on "Restore" in the iPhone section of iTunes. Choose the update file and wait for it to update. Choose set up as a new phone and it'll completely reset with no passcode.