If you are not yet comfortable with jail breaking your iPhone OS Firmware 3.1.2, using Blackra1n, here is a video tutorial which I came across on Softpedia. The video tutorial details, on how you can jailbreak your iPhone 3G and 3GS phones, which are updated to Firmware 3.1 or 3.1.2.
The video tutorial details how you can jailbreak iPhone 3G/3GS with OS 3.1 and 3.1.2 using Blackra1n.
The instructions in the video are pretty simple to understand. You may want to watch the video a couple of times, before you can start jail breaking your iPhone.