In order to keep your Android device secure you can either use a pin or a pattern lock to make sure that unauthorized people cannot access it. When you use a pattern lock the screen looks somewhat like this:

But what if you forget the pattern lock? You forget what pattern you had saved in order to be able to access your Android phone or tablet? Without remembering, your phone is rendered useless.
If you cannot pass through the pattern lock, you may need to reset your device. This will uninstall all the applications that you have installed and wipe off the related data, which you don’t want to do.
Bypassing the pattern lock with the help of your Gmail account
Almost every Android device has an associated Gmail account with it. Even if you haven’t been checking your Gmail messages on your phone or tablet, there is a great possibility that you have installed a few applications from Google Play, and if that is the case, you must have created a Google account profile in your Android device. This will come to your rescue now.
An android phone gives you 5 chances and after that it asks you to wait for 30 seconds before you can try again. There is also an icon called “Forget Pattern” and if you touch it, you are prompted to enter your Gmail credentials. Once you have entered the correct Gmail credentials, you are prompted to create a new pattern lock. Once you have done it, you can access your Android phone or tablet.
What if there is no Gmail account associated with Android phone?
Then this link has some nice instructions on how to bypass the pattern lock at the system level but it requires lots of technical know-how and you should be at least a bit familiar with flashing Android files.
In case you want to save some time and you can live with losing your phone data, the best option is to reset your phone. There are different button combinations that you need to press in order to reset your phone to its factory defaults. Refer to your device-specific documentation for that.