Hi,
This error can have a number of different causes:
1. Dirt or excessive dust buildup can create thermal issues or intermittent shorts which can cause the PC to freeze or shut down.
2. Faulty hardware.
3. Corrupt system files.
1. Give the insides a good cleaning using compressed air or a dust buster.
2. Use HP Diagnostics. Start the PC, tap "ESC", select "F2". Run system and component tests.
3. Open an administrative command prompt. Microsoft reference material using the following commands at the command prompt can be reviewed at this (Link).
Run the following commands:
DISM.exe /Online /Cleanup-image /Restorehealth
sfc /scannow
Regards