Here is info on that i had saved for a while now, and this works the same way for flashing recoveries also.
Before Flashing A ROM or .TAR file via ODIN
First, download the latest version of ODIN you can find. i use odin 3.07 which works great
Install ODIN on your computer.
Make sure that your phone's drivers are installed in your computer. If you connect your phone to the computer (and it doesn't have drivers), your computer will find and install them for you. Happened to all Samsung Galaxy devices.
Turn on USB Debugging Mode in your phone by going to Settings > More > Developer options > and check USB debugging box, and if this selection is not shown go to About phone under the More tab still and go down to Build number and tap it 7 times and then it will say developers option is now available or something like that and then go back to Settings > More and you should then see the selection for Developer options.
Make sure that your battery is fully charged or at least 50% charged.
Flashing A ROM or .TAR file via ODIN
Launch ODIN on your computer. Just allow it if your computer asks for permission. Mine does every time.
Unzip the ROM you downloaded (usually a .rar file). It might contain 3 .md5 files, just 1 .md5 file and sometimes, an additional .pit file.
Golden rule: Don't mess with the presets ever. Example, if re-partition is unticked, DO NOT TICK IT. The only time it gets ticked is when you upload a .pit file on the PIT box. If it does, leave it that way. ODIN TICKED IT FOR A REASON. Let ODIN do its job.
See bottom of post for guide on where to place files on ODIN.
Connect your phone to the computer using a USB cable. The box on the upper left corner of ODIN should turn yellow (depending on what version of odin) and the message "Added!" should be on display.
Click "Start" and wait for the box on the upper left to turn green and say "PASS!"
Your phone should auto-reboot after that and presto, you now have a squeaky new ROM/Recovery to play with and you can then disconnect the usb cable now.
Where To Place Files On ODIN
pit file ---> PIT box
If there is just one .md5 file or .tar file, no matter the label place in ---> PDA box
If there are three .md5 files:
file containing "CODE" ---> PDA box
file containing "MODEM" ---> Phone box
file containing "CSC" ---> CSC box
Hope this helps you out.