First, ensure that your carrier has unlocked your iPhone for use with a different carrier. Then, either insert a new SIM card from another carrier, back up and erase your iPhone if you don't have another SIM card, or restore your iPhone from a backup. The process might take a few days; only your carrier can unlock your iPhone.