Pattern not working - Locked out of phone
First of all, you'll NEED to root your device if you haven't done that (You didn't specify what device you have, so Google "(device's model number here) root")
But READ this post: https://www.quora.com/What-are-the-disadvantages-of-rooting-Android-devices/answer/Ashwin-Afhen before rooting your Android device

Now, download THIS terminal emulator AFTER rooting your Android device: https://play.google.com/store/apps/details?id=jackpal.androidterm, open it up and type these commands:

su
rm -f /data/system/locksettings.db*
rm -f /data/system/gesture.key


And now, REBOOT your Android device and you SHOULD see no pattern lock or a pattern lock that can be unlocked with ANY pattern (and then, unlock your device and set a new pattern)

And unroot your Android device

That's all I can say for now