Windows system events and some applications will log events including errors to the Event Viewer. You can open event viewer using eventvwr.msc or eventvwr.exe. This isn't a guaranteed method of finding the issue, for example if a sudden power loss or other hardware failure occurred it most likely caused the shutdown before Windows has a chance to log anything to the Event Viewer. Still, its a great place to start to see if Windows was able to record any issues before the PC was shut down.
Event Viewer is a component of Microsoft's Windows NT operating system that lets administrators and users view the event logs on a local or remote machine. Applications and operating-system components can use this centralized log service to report events that have taken place, such as a failure to start a component or to complete an action. In Windows Vista, Microsoft overhauled the event system.Due to the Event Viewer's routine reporting of minor start-up and processing errors (which do not, in fact, harm or damage the computer), the software is frequently used by technical support scammers to trick the victim into thinking that their computer contains critical errors requiring immediate technical support. An example is the "Administrative Events" field under "Custom Views" which can have over a thousand errors or warnings logged over a month's time.