PC stopped Working after a month?

Oct 6, 2018
5
0
10
PC has been working fine for about a month. Last night I was gaming on it and one of my fans started spinning very fast. I powered of my PC and let it sit for a few minutes. Then booted it back up. It worked perfectly normally for a few more hours and then it suddenly shut off. When pressing the power button, my motherboards ez debug says the cpu is not decteted or failed. I took it out to check for damage, and it would seem that everything is fine with it my PC specs are:
AMD Ryzen 5
B350 msi pc mate
Gtx 1060 3gb

Please help. Let me know if other specs are needed.