press and hold the power button PLUS the up volume button until the phone shuts off and then turns on. this should boot the phone back up.
if it doesn't, what were you doing prior to this issue happening?
I see, you got the phone back to boot up.
make sure you have fastboot turned off.
could be a rogue app causing your issue. could be low memory. could be any number of things. its hard to diagnose over the internet so all one can do is offer suggestion on things to try. these may or may not help.
if you are using htc sync to back up data, dont. use the standard google backup.
are you new to android? what was your last device?
do my procedure above--press and hold the power and volume UP button until phone reboots.
if the phone is under a grace period, take it back.
the htc one is a solid phone so don't worry about the build quality. even iphones have issues out of the box.
if you are up for it, do a factory reset.