A laptop that is constantly restarting unexpectedly due to a blue screen (BSOD) could be due to many factors. The next time it happens, take a look at the error code on the blue screen and search it up online. This usually points to the underlying issue. Here's a list of many common blue screen error codes:
KMODE_EXCEPTION_NOT_HANDLED
PFN_LIST_CORRUPT
IQRL_NOT_LESS_OR_EQUAL
KERNEL MODE HEAP CORRUPTION
MEMORY_MANAGMENT
Hope this helps!