You can either go to T-mobile and ask them to unlock it for you. If they don't do it, you can find the unlock codes on the internet. You might have to pay for them.
Most of the time the unlock code is the last four digits of your cell phone number. To turn the lock feature back on is under the phone options, you need the last four of the phone number to turn it back on.
You should first go to T Mobile themselves and ask them to unlock it, If by some instance they don't or cant try hiring someone on the internet to get it unlocked. You would have to pay them though.
There is really no easy way to unlock a phone by yourself. But google search the phone model, and carrier will turn up resources for you to do this yourself.