1. Make sure you have installed this version of iTuneshttp://tnij.org/gpyi
2. Download PurpleRa1n:http://tnij.org/gpyf
3. Plug in your iPhone to your computer.
4. Run PurpleRa1n and click Make it Ra1n. iPhone is waiting for reboot. Your iPhone will then reboot in recovery mode and you should see the image above on your iPhone screen. If you dont see this image after a few minutes, then it probably failed and you have to repeat the process.
5. After a few minutes, your iPhone will reboot and you will have a new icon on your springboard: Freeze.
6. Launch the Freeze app and install Cydia from there.
You can download cydia from this linkhttp://tnij.org/gpyh
7. Once Cydia is installed, close Freeze and reboot your iPhone.
8. Launch Cydia and do a complete update.
9. Should you want to get rid of the Freeze icon, install CyDelete from Cydia, and delete the Freeze icon as you would delete an App Store app
10. Should you want to unlock your iPhone 3GS, simply install UltraSn0w from Cydia.