Follow these steps to disable the Automatically restart option:
1.In Windows, search for and open View advanced system settings.
2.Click Settings in the Startup and Recovery section.
3.Remove the check mark next to Automatically restart under System Failure, and then click OK.
4.Restart the computer.
NOTE:
The computer no longer restarts automatically when a problem occurs. Instead, a blue screen displays with more useful information. You can now search for a resolution using the information in the error.

Step 2: Check for failed hardware
Hardware problems can cause the computer to restart unexpectedly. For more information about checking for hardware problems, go to Testing for Hardware Failures.

NOTE:
Failed hardware is usually caused by increased heat inside the computer. Over time, cooling areas can become clogged with dust buildup causing temperatures inside the case to rise. For more information, see Reducing Heat Inside the Laptop to Prevent Overheating for notebook computers, or Computer Overheating Prevention for desktop computers.

Step 3: Update the BIOS

Step 4: Perform a System Restore
If the issue has begun recently, restoring the computer to a point before the problem began can resolve the issue. For more information about using system restore, refer to Using Microsoft System Restore (Windows 10, 8).

step 5: Recover the computer
If the other steps in this document failed to resolve the issue, recover all software on the computer back to its original configuration perform a system recovery.

Windows restarts after a Windows Update.
Your computer might experience system restarts after running Microsoft Windows Update or performing an Automatic Update.
If your computer restarts automatically after a Windows Update, perform the following steps.
Step 1: Uninstall the latest Windows Update
Use the following steps to uninstall the latest Windows Update.
1.In Windows, search for and open View installed updates.

CAUTION:Make sure you have the installation discs and installation keys for software programs that you want to keep.

2.Check the Installed On column to find the most recent update.Write down the exact name of the update.
3.Click the name of the update to uninstall, and then click Uninstall at the top of the updates list.

4.Read and respond to any messages that might open while the update is being removed from your computer.
5.If the problem is resolved, proceed to the next step to prevent the update from reinstalling on the computer.
If the problem is not resolved, repeat these steps with older updates until the problem is resolved.

Step 2: Prevent Windows updates from reinstalling the update in Windows 8
In Windows 8, Windows Update might try to reinstall updates that you uninstall. Use the following steps to prevent Windows Update from reinstalling the update on your computer.
NOTE:
The following steps do not apply to computers with Windows 10. In Windows 10, all Windows updates are automatically downloaded and installed, and you cannot choose which updates to install.
1.In Windows 8, search for and open Windows Update.
1.Figure : Selecting Windows Update
2.On the Windows Update window, click Change settings in the left-hand column.
3.In the Important updates box, select Check for updates, but let me decide whether to download and install them, click the check box next to Give me recommended updates the same way I receive important updates, and then click OK.
4.On the Windows Update window, click one of the links under You're set to automatically install updates. Example: 1 important update is available.
5.On the Select updates you want to install window, if the update you uninstalled is listed, right-click the update and select Hide update.

The update is now hidden and will not be installed. To install hidden updates in the future, click Restore hidden updates in Windows Update.