A "T-Mobile network is not available" error likely means you are in an area with no coverage. Check the coverage map and, if it offers you should have good coverage, perform a factory reset of your phone.