You'll need to provide a lot more information than that to get help
here, and Event Viewer could be a good place to look. Look for an entry
that was recorded around the time you last experienced the problem. See
Using Event Viewer in the Help and Support Center for tips on how to use
Event Viewer.
You may be getting a "Blue Screen of Death" (BSOD); after which your pc is
automatically revbooting. To check this, turn off auto restart:
1. Right click "My Computer" and select "Properties".
2. Left click" the "Advanced" tab.
3. In the "Startup and Recovery" section, left click "Settings"
4. In the "System failure" section, uncheck "Automatically restart".
Hopefully, the next time your system crashes, you will see some information
about what the cause of the crash is.