Subscriber Identity Modules (SIM Cards) have built-in security to stop unauthorized use of the phone number. This can sometimes be as simple as the factory default "0000" four digit Personal Identification Number (PIN) code, or it can be a more elaborate four- to eight-digit code set by the user. Sometimes it isn't even set, and the SIM Card can be hot-swapped from phone-to-phone without entering a PIN number. However, the SIM card will always have a Personal Unblocking Key (PUK Code). A PUK Code is set at the factory and is unique to each SIM card. This code can be used to unlock a SIM card if you don't have the PIN.
Contact your cell-phone carrier to obtain the PUK Code. The PUK Code is retained by the carrier who supplied the SIM card. You may find it easier to call the carrier--often for free on the phone--or register your details and SIM card at the carrier's website and obtain the PUK code that way.
Attempt to unlock the SIM card using the phone. Enter a sequence of four digits three times. It doesn't matter what digits you use. You are forcing the SIM card to ask you for the PUK code, which unlocks all SIM cards.
Enter the PUK code when prompted by the phone.
Enter a new PIN number of your choice when prompted by the phone. Re-enter the PIN number to confirm your entry.
Reboot the phone by turning it off and then turning it back on. Then enter your new PIN number. The SIM card is now unlocked.