Contact T-Mobile. The carrier the device is locked to is the only source that can authorize an unlock.
How to unlock your iPhone - Apple Support
Contact T-Mobile. The carrier the device is locked to is the only source that can authorize an unlock.
How to unlock your iPhone - Apple Support
I did that and I was given a code but when I put in a different SIM card for another carrier, it don't activate.
Read the Apple instructions I linked to. With an iPhone there is no PIN to enter anywhere.
how to unlock carrier t mobile us iphone 6