How to remove jailbreak from my iphone 4s 6.0.1?

Hey guys, my cousin jailbroke my phone and now its turning off by it self, and some applications are not opening.
so i wanna reamove it with out losing anything, is that possible?
if no, tell me how to remove it.
thank you.

1. Connect your iPhone to your computer with cable
2. Open iTunes on your computer
3. Update iOS and then it'll automatically format your phone and installs iOS from the beginning.
Good luck!