iPhone 8 purchased through AT&T change to T-Mobile
Your original provider Controls the network lock status. 


https://www.att.com/deviceunlock/


Procedures differ per other providers, but for you, start at AT&amp;T to check your lock status or request it be changed.