If a cell phone doesn't have a SIM lock, insert the SIM card into the new phone and it should work so long as the phone supports the carrier's frequency band. Most cell phones have a SIM lock that prevents access to the network if the SIM card belongs to another carrier. If inserting a new SIM card prompts a request for a carrier code, the phone is SIM locked.
Different carriers operate in different frequencies, and the internal antennae of cell phones are normally compatible with a limited amount of frequencies. Most modern smart phones are compatible with multiple frequencies, and the same phone frequently comes in different versions based on the frequency bands it supports. Check with the manufacturer and the carrier to verify this information. If the phone requests a carrier code when inserting a SIM card, it means it's SIM locked. Carriers normally provide this information once a customer is out of contract or in good standing with the company for a specific number of days and requests the information. There is no standard procedure to request a carrier unlock code, so check with your carrier. Some carriers do not provide unlock codes at all. Some phones may be unlocked by other procedures without carrier consent.