Mostly new build crashes/restarts while gaming
Some back story might be helpful with this one. A couple weeks ago my computer wouldn't turn on, after messing around a bit I tried a new power cable and it worked fine. A couple days later the computer was running and power flickered at the house which shut the computer down. Wouldn't turn on again, just got a click and lights on the front panel flicked on then off again. A guy at work tried connecting a different power supply and I believe a couple other things and decided that the most likely cause was either the motherboard or CPU had been damaged. So I purchased a new motherboard, CPU, and case and reassembled using the previous PSU, RAM, GPU, SSD, and HD.
Current Specs:
Intel i9 9900k w/ Noctua NH-D15 cooler
Gigabyte Z390 Aorus Pro (non-wifi)
GeIL EVO Potenza AMD 16GB GAPB416GB3000C16ADC https://www.newegg.com/geil-16gb-288-pin-ddr4-sdram/p/N82E16820158561?Item=N82E16820158561
Nvidia Geforce 1070 Ti
Crucial 512GB SSD (C: drive)
2TB HDD (Storage)
Corsair CX600M power supply
Current issue is that the computer so far has run fine when doing normal tasks like working on Office or browsing the web/playing videos. However, when I start a game it crashes/restarts very quickly. Sometimes immediately, sometimes 2-3 minutes later. No blue screen or error message, it's like somebody just hit a reset button. In the game one second, next second I get a black screen and windows starts loading. I tried running memtest86 and got no errors, tried Intel's CPU test and got no errors, I even thought maybe my power strip had gotten damaged and tried another one but that didn't help.
I've tried running Speedfan to log temps, but it doesn't actually create a log file so I'm not sure if temp is an issue or not. What can I do on this? I'm lost at this point.