Assuming you have Windows, before you get started, here are the programs required: Samsung USB Driver: http://developer.samsung.com/technical-doc/view.do?v=T000000117 Odin 1.7: http://forum.xda-developers.com/attachment.php?attachmentid=428348&d=1288241246 USE THE RIGHT FIRMWARE, OR ELSE YOU WILL SOFT-BRICK YOUR PHONE Firmware: http://www.sammobile.com/ (Just enter in the Device Model and choose country) WinRAR: http://www.rarlab.com/download.htm
After everything is downloaded, put your phone into Download Mode, (Volume Down, Home and Power Button) once in Download Mode, connect device to Odin 1.7, and make sure everything is checked EXCEPT FOR RE-PARTITION then, assuming you have extracted the Firmware to your desktop, select PDA on the right side of the Odin Window and there should be a popup window, asking to select the .tar.md5 file, select it then press START in Odin, let the program do its thing then, it should say PASS or RESET then your device will reboot with the stock firmware, just like its factory new.