When your computer gets restarted, it may be due to the high workload and overheating. Sometimes when the machine o r PC gets busy or slows down, it started heating and it results in the shut down of the machine.
We have written a blog on the same topic, you can go through this and ask for any query.
https://ityug247.com/computer-restarts- ... ing-fixed/