There are magic unlock codes and there are always people on Craigslist offering to unlock phones for a few but. But yeah, buy unlocked phones. Alternatively maybe you could have used that phone with a T-Mobile mvno sim. Idk if that works with tmo locked phones and have been wondering.