To unlock your iPhone from its carrier, you'll likely need to contact your carrier directly to cancel your contract.
Changing physical SIM cards on your phone is always a fiddly business. First, you have to root for the little SIM tray tool ...
You can check to see if your iPhone is unlocked from a carrier using any of a few different methods.