I suggest you try one solution, put your PC into sleep mode, and see if it recovers from that automatically. If you do not know the particular source, try them all to find out more about it.
If you have discovered what is responsible for it on your system, skip all suggestions except for the one that matches your issue. This is the part where we apply the fix, to prevent that sleep mode is left automatically. The list is sorted alphabetically, and you should not have any issues finding the filter item in the menu.
While still on the command line, type eventvwr.msc to launch the Windows Event Viewer.