It could be a lot of things, from a driver issue to hardware stuff.
What error code?
And more importantlly, can U see any *.sys or *.dll file mentioned in the blue screen?
If it happened recently, then try a system restore from Start>run >type msconfig and launch system restore from normal windows(if U can get in) or from safe mode.
U can also run a chkdsk /r and maybe a sfc /scannow .
also, does it happen when U play a certain game or open certain things?
Could possibly be an overheating issue that's causing it to restart if you're playing a game. I would recommend monitoring your cpu temp and see how high it gets. If that seems to be fine I would check the ram.