To factory reset a locked phone through Recovery Mode, you need to turn off the phone first. Then press and keep holding the Power + Volume Up (or Volume Down) buttons till the recovery menu appears. Use the volume keys to go to "Wipe data/factory reset" and hit the Power button to choose it. Agree by clicking "Yes. " The phone will delete all the data and bring back the original settings. When done, click "Reboot system now. " Upon rebooting, you might be asked by Google Factory Reset Protection to enter your previously synced Google account.