Step-by-step Tutorial: How to Jailbreak and Unlock Your iPhone 3G Using RedSn0w 0.9.6b5 (Windows) [iOS 4.2.1]
UPDATE: Please think first, before you do something.
UPDATE2: If you have 05.13 baseband or lower – do not update to 4.2.1, use PwnageTool to create custom firmware!
IMPORTANT FOR UNLOCKERS
During this process you can update your baseband to the 06.15 version. If you are on 05.14 or 05.15 or higher you will need to do this to unlock. You do not need to do this for jailbreak only. Please read the following very carefully before deciding whether to do this.