How can I use a T-mobile locked iPhone 6 with an AT&T sim card?

I bought a used iPhone 6 and its fine and all (no iCloud lock, clean imei, etc.) but it has been set up with T-mobile already. I erased all content and settings as I didn't want to invade their privacy an tried to set it up as a new phone. I keep getting the message that my AT&T I'm card isn't compatible while trying to set it up. Is their any safe and legit way to unlock the carrier? A lot of services are costly and/or sketchy. Are there any free services or methods? If not what site is trustworthy?

Call t-mobile to have it unlocked provided that the previous owner has paid off the phone. If the previous owner is still making payments on the phone then t-mobile won't unlock it.