I have had my PC for about 3 years now, during some of those years recently I'd say maybe 2 almost, my PC has experienced random shut downs during gaming, it happened in roblox which isn't that heavy for the specs I'm using. I have a ryzen 3 3200g with 16gb of ram. My mother board is a X300M-STX. I have tested both the power supply and temps and neither of those are the cause of the issue. Before I buy more components I wanted to ask real experts to see how common this problem is. Sometimes it randomly restarts itself instead of shut down fully. When I say random it's just completely out of no where. Sometimes I am able to play for weeks without it happening, but now it shuts off if I even try to run a game for like 5 minutes. Another thing to keep in mind is that my specs aren't the newest but my pc easily runs most games with great fps and no lag spikes (at least the ones I play) so if it is running well but still does this, there has to be some type of weird problem going on.
Hope you can figure this out, thank you.