When you enter a wrong pattern for 5 times in a row a message will appear with "Forgot Password?" option enabled. Click that link and enter the Gmail account that is used with the phone. If the phone is connected to the Internet through wireless or Data carrier then you will receive a password on your email which you can use to unlock your phone. In the other case (no Internet enabled) you must perform a hard reset of the phone (press and hold the Volume UP+Home+Power buttons, and select Wipe Data/factory reset) and in this case you will lose all your settings and applications on your phone. The contents of the storage card will remain the same.