This guide will teach you how to jailbreak the iPhone 3GS running iPhone firmware*3.0 on using redsn0w and OS X. This is NOT for firmware 3.1. After following this guide you can unlock your iPhone 3GS*using ultrasn0w.
Your iPhone 3GS should already be on firmware*3.0 before you begin.
Download redsn0w 0.8 (OS X)
Download iPhone 3GS firmware 3.0
Extract the redsnow 0.8 archive. Run redsn0w. Click Browse.
Browse to where you download the iPhone 3GS 3.0 firmware .ipsw. Select it and click Open.
After a few seconds redsn0w will tell you that your IPSW has been successfully identified. Click next.
redsn0w does some patching.
Choose your options. Click next.
Follow the directions to connect in recovery mode.
redsn0w now uploads the needed files to your iPhone 3GS.
After redsn0w is done uploading the needed files it says Done. You may click finish now. Beware your iPhone will be running the jailbreak at this time. Do not mess with it while it is working. Once it is done it will boot to the lockscreen and you will be jailbroken!