One possible cause of this problem is overheating, which can have many causes. However, if your Windows 11/10 computer shuts down randomly but is not overheating, take these steps to fix the issue ...
Both Windows 10 and Windows 11 have a bug that causes your PC to restart when you choose the Update and shut down option.