Hook it up to your computer, and restore via iTunes. Of it needs updating, iTunes will prompt you to download the firmware. Just before you restore, iTunes should ask if you want to backup your data prior to restoring... It's best that you do this even if you want to restore as new, just in case you need it later.