Firstly, is automatic restart enabled? If so, follow these instructions to turn automatic restart off:
...this way you can find out if your computer is automatically restarting because it's encountering an error (in this case, the next time your system randomly restarts, you'll be confronted with a blue screen with an error message).
Your event manager will also log and give details about errors if they occured within Windows (Start
> Control Panel
> Administrative Tools
> Event Viewer
) however it can be confusing since you have to look for errors at the time it occured, and it is less direct.