HTC One S shuts off when power button is pressed
I've been extremely frustrated with my HTC One S for the past one week. I have no idea why my HTC One S keeps doing this, but at random times, it keeps switching itself off. It only happens after the power button has been pressed, but not every time.
The three touch buttons at the bottom (back button, home button and recent apps) start flashing, then a little box appears telling me to keep holding down the power button to restart the phone. Pressing or not pressing the phone's buttons doesn't seem to stop this process. Then, my phone crashes/shuts off and takes a while to turn on again.
Please help me, thank you!