IMEI is the only possible way to unlock an iPhone free-of-charge, which is confirmed only when your carrier has free unlocking. In most cases, you can call your carrier, give them the IMEI (which you can find in Settings > General > About), and ask them to unlock your phone - provided that your phone matches the unlocking criteria (e.g., not reported as lost, and completely paid off). Try not to use sites that offer free unlocking with IMEI since most of them are scams. Apple does not unlock iPhones itself, it has to do it with the carrier.