1-open my computer properties
2-go to advanced
3-the third point you will have their will be of startup and recovery
4-go to the settings of it
5- a dialog box will open in which the 2 column will be of system failure in which you will find that there is a tick on automatically restart
6- untick that
7-click on ok and apply
O R
you will need a system restore
1- go to start
2-all programs
3-accessories
4-system tools
5-system restore(fix the date that is available and of the time when your computer was working properly)