Question My PC keeps shutting off ?

Jul 30, 2024
2
0
10
Pc keeps shutting off when booted it stays on for a bit but when a app or a game opens it plays for a bit then either display turns off or freezes and along with it so does the mouse and keyboard.
The power light on the PC indicates it's on, but there's no display and no working mouse or keyboard.
Everything runs well but the POST lights for CPU and RAM come on when said crash happens.

OS: Windows 11

Edit: I am pretty new to this pc stuff so i would like some help figuring this out.