Hard reset HTC One: settings menu
Like all Android devices, you can perform a factory reset from the settings menu of your HTC One. Simply hit the Settings icon, scroll down until you see Backup & Reset, then at the bottom of the next screen, tap Reset Phone. You will be shown everything you will lose upon performing the reset. If you have backed up your important data and wish to proceed, tap OK and then confirm your choice. Your HTC One will now reset itself and restart with all of your data wiped.
Hard reset HTC One: hardware buttons
If there’s a problem with your screen or you’re otherwise unable to do a factory reset via the settings menu, then you can use the hardware buttons to do a reset too. Simply turn your HTC One off, then press and hold the Volume Down and Power buttons. Continue to hold them until you enter the H Boot screen.
From here, simply use the volume keys to scroll down to Factory Reset and hit the Power button to confirm. Be warned though, there is no last minute warning, so as soon as you hit Power your phone will reboot and restore factory default settings.