The quickest test is to borrow a friend's SIM from a different carrier and pop it in. If the phone asks for an unlock code or shows no service with a valid SIM, it's locked. You can also check in the settings menu; many phones now show carrier lock status under About Phone or network settings, and your carrier's app or support line can confirm it.
Phones bought outright at full price are usually unlocked; phones on installment plans or contracts from a carrier are often locked until paid off. Rules differ a lot by country, but most carriers must unlock your phone free once you meet their conditions, typically that the device is fully paid and the account is in good standing. Request it through the carrier's website or support line, and allow a few days for processing before your trip.
Do this well before departure, not at the airport. Avoid third-party unlocking services; they can be unreliable, and an official carrier unlock is permanent and survives software updates.