There are two basic methods: Obtain the network unlock code: You can either contact the carrier or get the network unlock code from a third-party phone unlocking website. This service is mostly not free and the price varies with phone, carrier, country and the unlocking service. Use an unlocker: This method is not recommended unless you know what you’re doing. Using the wrong unlocker / patcher could brick your phone. Galaxy SIM unlock is a good example of an offline unlocker for lower model Samsung Galaxy phones. For the greater good, we wont be providing a list of unlockers because some people will keep trying each (hoping one would work) and end up bricking their phones.
Source: http://blog.hovatek.com/how-to-unlock-an-android-phone/