At first the pc would shut down and restart primarily while gaming, which made me think that it was a temperature problem. However recently, it started started happening while doing light gaming like league of legends with capped FPS or while watching youtube videos. I have recently installed 5 new case fans to make sure cooling isn't an issue and yet the problem persists. On the event viewer it shows up as event ID 41 each time. Yesterday I tried a memory diagnostic test again, which came back clean as expected but the pc restarted on its own 3 times after the test which would make me think it's a RAM problem. Half my system at this point is less than a year old, including the RAM. To be specific my setup looked like this:
i5 7400 -> Ryzen 7 5800X (after upgrade)
rx 580 8gb
16 gb ddr4 2400 mhz -> G.Skill RipjawsV 16GB DDR4-3200MHz (after upgrade)
BEQUIET PSU SYSTEM POWER 9 700W Bronze
H110m MB -> B550m Steel Legend (after upgrade)
i5 7400 -> Ryzen 7 5800X (after upgrade)
rx 580 8gb
16 gb ddr4 2400 mhz -> G.Skill RipjawsV 16GB DDR4-3200MHz (after upgrade)
BEQUIET PSU SYSTEM POWER 9 700W Bronze
H110m MB -> B550m Steel Legend (after upgrade)