Hi there,
As you have stated that these are recent issues, have you made any recent updates to the server?
If so try uninstalling them and see if that improves the crash. It could also be great if you can share the logs so that we can look into them for more convergence towards the issue.
I would also recommend you check your hardware if your power supply is functioning properly or if the CPU is not overheating to cause the computer to shut down.
The below thread discusses the same issue and you can try out some troubleshooting steps from this and see if that helps you to sort the Issue.Windows Server crash and restart https://learn.microsoft.com/en-us/answers/questions/669580/windows-server-crash-and-restart.html
----------------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer–