Welcome to the HP Support forum. Thank you for posting.
Based on your description, I think that what you experience is Blue Screen of Death (BSOD). Please, confirm to me if you notice this blue screen. If yes, BSOD is kind of Windows self-protection feature. If you received a blue screen error, or stop code, the computer has shut down abruptly to protect itself from data loss.
A hardware device, its driver, or related software might have caused this error.What you describe could happen because of incompatible with Windows driver (most often) or because of hardware issue (rarely).
In order to troubleshoot, I would need some specific information.