If you’ve already tried a Factory Reset on your HTC One M8 and it hasn’t solved your problem, the next step might be a Hard Reset. A Hard Reset is basically the same as a Factory Reset but you do it manually with the hardware buttons. You also have a little more control over what gets deleted.
First of all you need to first make sure Fastboot is disabled in Settings > Power.
With your HTC One M8 switched off, hold down the Volume Down button and press Poweruntil you see the screen with three Androids at the bottom. If you just want to do a Factory Reset with the hardware buttons you can do it on this screen. Using the Volume buttons, scroll down to Factory Reset and use the Power button to confirm. This will Factory Reset the device.
If you want to wipe the cache partition as well (what I consider a Hard Reset), simply do your reset via the Recovery Menu. Instead of scrolling to Factory Reset scroll down to Recovery and hit Power to confirm. You will briefly see the HTC screen then you want to press Volume Up and Power to access the Recovery Menu, then all the way to the bottom to Wipe Cache Partition. Once you’ve done this you can then Factory Reset via Recovery and reboot.
Once your HTC One M8 reboots you’ll be prompted to log in with your accounts again and restore all of your data and settings, depending on the Backup account you have enabled.