If you get an alert about the SIM card in your iPhone - Apple Support - https://support.apple.com/HT201420
Find out what carrier your phone uses: Settings > General > About > Carrier
Then see if your carrier allows unlocking:
How to unlock your iPhone for use with a different carrier - http://support.apple.com/HT201328 - Only some carriers offer the ability to unlock iPhone for use on any carrier. Follow the instructions in this article to unlock your iPhone.