If your laptop restarts out of nowhere, you should check for drivers updates and for conflicting applications. Please boot in Safe Mode and disable every startup application using Windows + R > msconfig > Startup tab.
After this step, please observe the behavior of the operating system. If it restarts again, the problem is probably related to a driver or hardware.