Select Menu > Settings > Rest. factory sett. (or Reset device or Restore factory sett. or Rest. fact. sett.).
Enter the security code before the restore. If you have never changed your security code, then enter the default code 12345. If your phone still requests a security code or if you have forgotten it, please bring it to the nearest Nokia Care point for inspection.