Greetings,
Welcome to the forum.
I am not a HP employee.
This symptom can be caused by flaky hardware or corrupt drivers or system files. Faulty RAM, or a failing HDD, or a failing power supply or a faulty system board can cause this behavior. Bad hardware is easier to troubleshoot. Software/driver issues can be tough to pinpoint.
Can you recall how long you used the PC before this started happening? Seeing this problem at first boot would suggest a hardware problem. Or seeing this within days after first use with no operating system modifications would also suggest a hardware problem.
Check hardware:
Tap "ESC' at startup.
Select "F2".
Run hardware (system and component) tests.
Check system file integrity:
Open an Windows administrative command prompt.
First run:
DISM.exe /Online /Cleanup-image /Restorehealth
Then run:
sfc /scannow
I would then contact HP Support (Link) for warranty service if you can't isolate the cause.
HP Support may tell you to back up data. Then do a factory reset using HP Recovery Manager or external factory recovery media.
Regards