Each device has its own IMEI code that it can be recognized by. If you want to unlock the device, it will be done on the IMEI level. The particular code of your phone will be whitelisted in the database. When you insert a SIM card of a different network provider than your default one, it will check if the IMEI basically allows the phone to be used with the other carrier. If you have whitelisted the IMEI previously by unlocking your phone, then you’ll get signal with the new SIM card to start calling and browsing the web.
It is not hard at all to find out the IMEI code. You can’t whitelist the code all by yourself, but you can send it to one of the service providers who will process your phone unlock. This is official factory unlock which is totally safe and legit. Even your phone’s warranty is safe.
The easiest way to get your IMEI code, and this works with almost any device, is to dial *#06#. The code comes up to your gadget’s screen. Write it down and use it for unlocking.
Another way to find out the IMEI code, which works with all iPhones, is to open Settings -> General -> About -> IMEI.
Third option to look for the code is to open the SIM card holder of an iPhone. The IMEI code is written down there on the little piece of metal. For other phone models you can open the phone where the battery is, and find it together with the serial number.