Lutfij :
If your system randomly restarts while under load or taxation then the issue can be limited to thermal issues or a lack of ample power from the PSU. If you system reboots at idle, then it's highly possible that the (OS)drive is faulty or that the PSU is failing.
Mind sharing your full system's specs like so:
CPU:
Motherboard:
Ram:
SSD/HDD:
GPU:
PSU:
Chassis:
OS:
Side note, are you on the latest BIOS revision for your motherboard?
CPU: Intel core i5 7500 3.40GHz
Motherboard: MSI B150M Pro-VH
Ram: 1x Crucial ballistix 8gb 2400mhz DDR4
SSD/HDD: 1TB Western Digital
GPU: Gigabyte Geforce Gtx 950 2GB
PSU: Corsair VS550 watt
Chassis: Antec GX200
OS:Windows 10 Pro
I'm not sure if my BIOS is the latest version but my current version/date is:
American Megatrends 1.C0, 2017/04/20