These are instructions on how to jailbreak your iPhone 3G on the 4.1 firmware using RedSn0w for Mac. If you are on a lower firmware version and need to unlock then stay on your current version and follow this jailbreak tutorial.
Step One
Create a folder on your desktop called Pwnage
Download RedSn0w from here and place it in the Pwnage folder. Likewise, download the latest 4.1 firmware from below and place it in the same folder.
4.1.0 (3G): iPhone1,2_4.1_8B117_Restore.ipsw

Extract the redsn0w app from the RedSn0w zip file by double clicking it.

Connect your iPhone to the computer and launch iTunes.



Once iTunes has finished updating your iPhone to the desired firmware open the Pwnage folder on your desktop and launch the redsn0w application from the redsn0w folder we extracted earlier.

Step Four
Once RedSn0w opens click the Browse button
Step Five
Select the 4.1 firmware ipsw we placed in the Pwnage folder on our desktop then click Open.
Step Six
Once the firmware has been verified click the Next button to continue.
Step Seven
RedSn0w will now prepare the jailbreak data
Step Eight
From this window you can select the jailbreak options you would like.
Verbose boot displays detailed information on boot of your device and is generally only needed by developers and advanced users.
Once RedSn0w opens click the Browse button

Select the 4.1 firmware ipsw we placed in the Pwnage folder on our desktop then click Open.

Once the firmware has been verified click the Next button to continue.

RedSn0w will now prepare the jailbreak data

From this window you can select the jailbreak options you would like.

Make sure Cydia is selected. For this tutorial we will also select Custom boot logo and Custom recovery logo.
When you click to select each custom logo option a dialog window will appear asking you to select the image. Locate the image you would like to use then press the Open button.

Notice that RedSn0w has already selected to Enable multitasking, Enable homescreen wallpaper, and Enable battery percentage. If you do not need multitasking we would recommend deselecting it as it makes your iPhone 3G run very slow.
Click the Next button to continue
Step Nine
Please plug your iPhone into the computer and make sure its OFF then click the Next button

RedSn0w will now guide you through the steps to get into DFU mode. You can find more help with DFU mode here
Hold down both the Home button and the Power button for 10 seconds.


Your iPhone will now reboot

RedSn0w will then begin uploading the new RAM Disk and Kernel.

Once this is complete you will be notified that RedSn0w is done. Click the Finish button. When your iPhone finishes rebooting (5 minutes or so) it will be jailbroken with Cydia on the SpringBoard.

[via iclarified]