Owing on your phone doesn’t tie you to your carrier. Leaving makes the remaining balance due and stops any monthly credits, so pick a new carrier whose switching offer reimburses that balance. Check how long you must stay to keep the money, and if you’re keeping the phone, get it unlocked before you move your number.

Source