So my computer stopped restarting but I have no idea what fixed the issue. I changed my power supply, thermal paste, CPU cooler but none of them fixed the issue. But there was an issue with my microphone driver or something that popped up a few weeks ago which led me to restart my computer everyday on my own and ever since then my computer has stop restarting on its own. So I'd say to try restarting on your computer manually everyday and see if that fixes it. If this doesn't fix it, I have no idea what fixed it and just randomly decided to stop restarting on its own after 6 months.
The issue's been fixed but I have no idea what fixed it. My comment above says what I think fixed it but I don't know. I tried different outlets, different houses, and a different power supply so I don't think it was a power issue.