There are a few different programs you cam use to jailbreak your iPhone. Two are redsn0w (http://blog.iphone-dev.org/) and limera1n (http://limera1n.com/). There are several others but these two are the safest. With the iPhone and any 3G connected iDevide you must be careful about what you upgrade so that you don't mess up your baseband/3G stuff.