This one is for jailbreakers only:
If you’re trying to unofficially unlock your iPhone, there are lots of guides around. I’d recommend the unlocking tutorials at iClarified, in particular. But it can be confusing.
I like sites that cut through the cruft, and I’ve just found out about Can I Unlock My iPhone?
It’s up-to-date with current jailbreak and unlock developments, and gives you a simple answer, based on your iOS device and firmware.
If you’re looking for an official unlock from your UK mobile phone network, then I’ve previously written about that (but it needs to updated for iPhone 4).