Question PC shuts down and then automatically restarts with games or while working

Aug 25, 2020
Hi! I currently have a R5 2600X that is not overclocked and works with the stock cooler, I've had this pc since almost a year ago and it has been working perfectly, until recently, my pc started to shut down and restart when its required to "work more" or at least that's what I think, I can totally browse the internet, use discord, play not so demanding games, etc. But when I try to play a game like fall guys, the moment the match starts it shuts down, I don't know what to do, and I think it may be because of the cpu, since I tried running a prime95 test to see what was happening and it just shut down my pc 5 seconds after starting the program, I've also tried looking at my cpu temperature with Core temp, and it usually stays around 43° C, but when I tried running a game of fall guys to see if It had anything to do with temperature, I could only notice the temperature go from one second to another to 54°C and then instantly shuts down my PC, I really don't know if it is because of the CPU or the PSU, I have a cooler master 750W 80+ Gold, I've read online it may have anything to do with the PSU or needing to change the thermal paste on the cpu, Can anyone please help me? I would like to know how to fix this since I need my computer to work (It also shuts down while working sometimes, I'm a game developer and the current project I'm working on its kind of heavy)