It is not uncommon for a cell phone to accidentally get water damaged; it might go through the laundry in a pair of pants or accidentally fall into water. Though this usually means your cell phone is ruined, you can usually save your phone's SIM card.
Go to T-Mobile
Take your phone and SIM card to your local T-Mobile store. Explain to a sales representative what happened and see if your phone is still under warranty or if there is an easy way to fix it. The representative should be able to give you several options that may include buying a new phone or buying a refurbished phone.
Dry the SIM Card
Dry your SIM card thoroughly. Placing it on a dry, clean surface on a paper towel is the best option. Depending on how wet your SIM card is you may need to let it dry for several hours. After your card has dried try putting it back into your cell phone to see if it works.
Buy a new SIM card
If your SIM card is ruined, purchase a new one from T-Mobile. SIM cards range between $10 and $14 depending on the type of phone that you have. You may not be able to recover all of the data on your phone's original SIM card, and may need to rebuild your contact list.