Sometimes, windows restart again and again when you select the option of "restart automatically". You must uncheck this option by following these steps.
Start > Control Panel > System, in System Properties click the Advanced tab, then under ''Startup and Recovery'' click the ''Settings'' button, and remove the tick in the option ''Automatically restart''.
It will resolve your issue.
Another issue of computer hanging is when you use heavy antivirus. Used avast trial system, it is cleaned and also using malwarebytes also cleaned