In order to flash a stock ROM to your phone, you will first need to download a compatible ROM. Browse to Samsung Updates to download the required ROM as it's a public repository with stock ROMS. Choose the right version of the ROM by hovering above the three letters to identify the country you're in then click download and download the file. Next you will need to get the flashing tool. You can search on Google for Odin 3.07. The third step is to put the phone into Downloading Mode. You can do this by pressing Volume Down + Home Button + Power Button. Attach the phone to a computer, but after you have installed Samsung Kies. Kies is necessary as it contains all the required drivers to complete the operation.
Unpack and run ODIN, connect the phone (while in Downloading Mode) tick the PDA button and select the archive you have downloaded. Please notice that you'll need to extract the archive and then select the TAR.MD5 file. Wait for the process to complete until ODIN displays PASS and the phone will be restored to a stock ROM.