Normally you would have to either plead with your carrier, providing a good reason, to get them to unlock your phone for another carrier. If you aren't able to get the carrier to unlock it you would then have to go find a website that provides the service, or study up on the process for yourself searching through various threads and youtube videos hoping to find the one true method. This may not be the case anymore if T-Mobile has anything to do with it. Tmo released a bit of leaked information from some credible sources yesterday. They said that in their use of the upcoming Galaxy Avant they noticed a pre-installed app for carrier unlocking the phone. They tried the app out and sure enough after it ran its course the phone was carrier unlocked. He apparently even tried a Verizon sim card which did work. He also said that after rebooting the phone the application was gone. This is obviously unconfirmed and may or may not actually be included on the final product.
Via T-MoNews