The sim card has to fit in the slot properly and be accepted by your service provider if the phone has been legally jail broken to use with other services.
Most providers lock phones to accept only their SIM cards. You will need to contact AT&T to get the code to unlock the phone for another provider's card.