iPhone 3GS locked to at&t. How do unlock it?
You'll either have to get in contact with AT&amp;T, pay a 3rd party to unlock it or jailbreak it. 

If you're going to try and contact AT&amp;T then you'll have to go to their website and fill out a form to start the dialogue. If you need a ZIP code Google the one for Grand Central or something.

The GiffGaff Unlockipedia is a good place to start when looking for a 3rd party to unlock the phone. http://giffgaff.com/unlock/apple-iphone-3g-phone

Not so up on the jailbreaking scene these days but Lifehacker is usually good for the information. http://lifehacker.com/5771943/how-to-jailbreak-your-iphone-the-always-up+to+date-guide-%5Bios-61%5D