Call up your service provider
Tell them you frequently travel to another country and you want to use SIM cards from over there so you need the unlock code
If they tell you "no" keep insisting
It's easier to do this in America because almost all of our phones are not GSM (i.e. no one is really up on what unlocking really is so companies give out unlock codes like free candy)