If you are playing games on your computer and your computer is restarting automatically then maybe this is because of overheating or some kind of hardware failure, i am writing some ways by which you can solve this problem:-
- Check your cooling fans if it is working properly or not
- If you haven't cleaned your PC from inside for many days then please do so
- Check your PC temperatures
- Check your GPU