Originally posted by Jenny:
When you insert a SIM card from a different provider it would say "locked SIM" (or something similar) if the phone is not unlocked or it would just recognize it and everything will look normal
Depending on your GSM phone, you can either call the provider and ask them for the unlock code (which they don't like to give out), you can buy it online for $2 - $7 depending on the type of phone, you can ask someone from ebay who sells a phone like yours to give you the code (of course tell him/her that you are in the military and want to keep in touch with family while deployed) people are really helpful with things like this and you have a great chance of getting the code for free. And last, but not least, you can buy a used or new unlocked phone from ebay, but I wouldn't spend too much money on it or go for a fancy phone because once you get to your location the chances that you'll damage it are pretty high (sand, water etc.)
Just want to add that the phones that your purchase from your providers always come locked. T-Mobile is the only company that I know for sure that gives out their unlock codes.