Buy a T-Mobile SIM Card - T-Mobile has two SIM cards which are interchangeable. Go to a T-Mobile store and buy a new 39.01a type SIM for $20 (see picture below)
Remove AT&T's SIM from the iPhone. To do this use a pointed object (pin, needle or staple) and push it into the center hole located on the side of the phone. The SIM cradle will pop free. Pull out the old AT&T SIM and use it as a template for the new T-Mobile SIM card.
Trim the T-Mobile SIM Card - Align the metal contact area on the T-Mobile SIM with the existing AT&T Micro SIM, pay attention to orientation of the notch & cut into the SIM cards keeping them in the same direction. If you have the right SIM style, it’s pretty easy, you really just need to align the SIM as closely as possible. When cutting out the SIM, do not initially use scissors — doing so will put a lot of stress on the SIM itself and if you hear a “crunch” noise you’re destroying the SIM. I used a knife to cut out the SIM and a very sharp set of scissors to trim it in order to get it to fit into the iPhone4 SIM cradle. Make sure that there’s no protruding shards of plastic, if there are, you may have a very hard time removing your SIM card.
Jailbreak Your iPhone - Insert the old AT&T SIM card and turn off 3G under settings. Using your iPhone4 (connected to Wi-Fi network) browse to jailbreakme.com on the phone and follow the instructions. Once the iPhone is jailbroken, you can move on to further steps. If you can’t “slide to jailbreak” you may need to factory reset your phone using iTunes. (See video below)
Update Cydia & Install Ultrasn02 - There will be a new application on your iPhone Cydia (directory of applications), open it and allow it to upgrade itself if is needed. Search for the app ultrasn0w and install ultrasn0w. Once it is installed, you will be prompted to reboot the phone.
T-Mobile Setup - Make sure you have an unlimited data plan with T-Mobile, they have an unlimited service available which can be ordered by asking for the Blackberry data or Android service. That will come with SMS and MMS services as well. First you need to re-enable your data plan and MMS, you can do that by going to Settings -> General -> Network -> Cellular Data Network and enter the following: