What he said ^^^, you would have to contact the carrier for an unlock code - IF it's carrier locked. Each device has it's own unlock code, based on IMEI.
You don't have to contact the carrier, though that's one option. Any high street phone repair shop can unlock phones, just drop in and they'll charge you a small fee. It does require the correct unlocking kit however, not s simple code, so you will need a repair shop to do it.