You need to connect the phone to your laptop/pc with a cable.
While it's charging, keep pressed "Volume Down" and "Power" buttons together, and when the screen goes black, left the volume button ONLY, and then keep pressed the "Volume Up" while still keeping the power button pressed and keep on holding power and volume up until you reach the recovery menu.
Then select "Wipe Data/Factory reset" from menu (use volume buttons to navigate the menu and Power to confirm)
After the reset, select "Reboot system now"
IF the phone was connected to ax existing google account it will ask for your mail/password before completing the setup after the factory reset, so recover your data before attempting (https://support.google.com/accounts/answer/7682439?hl=en)