If you need to find out your iPhone's carrier without a SIM card installed, you can do so through the Settings app.
To unlock your iPhone from its carrier, you'll likely need to contact your carrier directly to cancel your contract.