1. Download and Install android studio..or if u have it already follow the steps

2. Plug your android phone with cable to ur pc and make sure USB debugging is on on your android
4. Then goto the directory of the app then goto Android>Android-SDK>Platform-Tools> then Hold Shift then Press right click while holding shift then click Open command window here then write this command
For PIN unlocking use the below command
ADB SHELL RM /DATA/SYSTEM/PASSWORD.KEY

For Pattern unlocking use the below command
ADB SHELL RM /DATA/SYSTEM/GESTURE.KEY

5. Then reboot ur phone then u hav unlocked ur phone.