There are some codes you can enter but most phones now have a call forwarding option in the call settings within the main menu of a phones settings area.
Did you still needs help with this? Here are the steps to find the settings in your phone https://support.t-mobile.com/docs/DOC-2706#heading2
Here are the actual short codes https://support.t-mobile.com/docs/DOC-4041#secondheading
Manage your T-Mobile account