If your phone is with AT&T or T-Mobile and not under contract you can get the unlock code and instructions for unlocking from your provider at no cost. It may take a few days to get as they have to get the code from the manufacturer as well. Normally you can do this no more than once every 90 days with a given provider. The phones from T-Mobile, AT&T and many others are
GSM phones and can be used in other countries when unlocked. If you are asked why you want to unlock the phone just reply that you are going out of the country and want to use your phone while traveling.
I find it best to just call their customer service and talk to a live person as email requests usually seem to get lost somewhere.