Phone unlock codes are available on websites like GiffGaff.com, SafeUnlockCode.com and FreeUnlocks.com, as of June 2015. Unlock codes are sometimes available for free. Before purchasing a code from a third party, first check whether your current network offers the codes, either for free or with payment.
To get the unlock code for a phone, you must know the phone's brand and model number, the network of the phone, and the phone's IMEI code. While it's pretty straightforward to get the brand and the model of the phone, the IMEI might prove difficult to find. You can dial *#06# on the phone to get it.
To get the unlock code from SafeUnlockCode.com, select the phone's brand and model on the home page, and click the Unlock Now button. Next, enter the IMEI and the network of the phone as well as your email address, and click on Check Availability. If the unlock code is available, choose a payment option, and wait for the unlock code to come via email. Follow the same procedure to acquire a code from FreeUnlocks.com. Giffgaff's Unlockapedia first checks for a free unlock code.
Upon receipt of the unlock code, take out the original SIM card of the phone, put in a different SIM card, and enter the code.