Laptop randomly restarts

About 2 weeks ago i bought a new laptop, its been working fine until a few days ago. I noticed that it would restart at random (not shutdown). sometimes it stays on for an hour, sometimes a few seconds. it even restarted during the boot up process. Since then ive ran a malware scan and a hardware diagnotic test and they have both detected no problems, so im sure this is not a virus or hardware problem. I have noticed that the fan stays on for longer that normal (though im sure this is not a heat issue as i played a few games at high settings and they ran fine). Im thinking that this could be a software or update issue, thoughts?

Specs:

HP Victus

Windows 11 Pro

24H2

1920x1080 144hz

‎AMD Radeon RX 6550M

Ryzen 5 7535HS

16GB DDR5 RAM

1TB SSD