If it's AT&T it's really easy, they have a website where you request the unlock. Once that's accepted (might take a day) you just connect your phone to iTunes and it unlocks it. This was free.

You *do* need to have a SIM in the phone, but it doesn't have to be the AT&T one (I had a dead AT&T sim in there when I did it on an old iPhone 5).