Plug the iPhone into a power source (preferably the wall and not a computer) then press and hold the home button and the lock button at the same time until it restarts. This will force the phone to restore itself to factory settings and wipe all memory. (if it is not plugged into power all this will do is force the phone to restart)