Instructions on how to perform an untethered jailbreak of your iPhone 3GS on the iOS 5.0.1 firmware using RedSn0w for Mac. The Windows version of this tutorial is here.
This procedure will cause you to upgrade your baseband potentially ruining your chances for an unlock. Please follow a tutorial on how to update to iOS 5.0.1 using a custom ipsw if you need an unlock.
Create a folder on your desktop called Pwnage
Extract the RedSn0w zip file by double clicking it.