You will need the unlock code for the phone before you can swap SIM cards. You would either need to contact the carrier who sold the phone or use an unlocking service.
If you had a SIM card from one cellphone company (i.e. T-Mobile) and you wanted to purchase a cellphone from another GSM company (i.e. Cingular) which your cellphone company didn't carry, do you simply buy the cellphone and put in your SIM card (i.e. from T-Mobile)?