Users can take advantage of the Comex browser-based jailbreaking tool to allow for the installation of unapproved apps. One of those apps is ultrasn0w, which is available through Cydia, the non-Apple iPhone app store. Users will want to chose version 1.0-1 of ultrasn0w.
According to the iPhone Dev Team blog, it works for iPhone 4 baseband 01.59 and 3G/3GS basebands 04.26.08, 05.11.07, 05.12.01 and 05.13.04. The baseband numbers reflect what software version the iPhone's modem is using. Some baseband numbers have given the Dev Team great difficulty in unlocking. If you don't have a phone with one of the previously mentioned basebands, the unlock won't work.
Jailbreaking and unlocking doesn't come without risks. First, you can brick your iPhone. Second, it's possible Apple may take steps to disable the iPhone. Third, jailbreaking makes the iPhone more susceptible to being attacked by ne'er-do-wells.
Why bother? Well, the biggest benefit of jailbreaking is the ability to run non-approved apps. When the iPhone was first launched, there was no app store. This was a big deal back then. Now that the iPhone App Store offers more than 200,000 applications, there are very few types of apps that haven't been approved by Apple.
One example that came to light earlier this week demonstrates the idea perfectly. FaceTime, Apple's video chatting software, officially only works when both iPhone's have a Wi-Fi connection. Jailbroken iPhones, however, can run FaceTime over 3G networks, too.
The benefits of unlocking are clearer. If you don't want to use the iPhone on AT&T's network in the U.S. (or corresponding network in other countries), unlocking makes it possible to use the iPhone on other GSM-based networks. In the U.S. that primarily means T-Mobile. The big drawback, however, is that none of the iPhones supports T-Mobile's 3G network, which is in the 1700MHz AWS band. It supports AT&T's 3G and the 3G of carriers in some parts of Europe and Asia, but not T-Mobile's.
Remember how awful it was using the first-generation iPhone only on EDGE networks? Yeah, that's what it will be like if you jailbreak it and use it on T-Mobile's network. Is that worth it? I can't say for sure. Your call.