Contact the carrier it is locked to. Assuming it is locked to AT&T, and you are/were actually an AT&T customer who either fulfilled your contract or paid the early termination fee (or purchase a no commitment phone), then you can have it unlocked.
If you are/were not an AT&T customer, they will not unlock it. The phone is useless to you. Sell it and buy one in the UK.
If it is a Verizon or Sprint phone, just sell it. You can't use it at all. Those are CDMA phones and will not work on a GSM network.