To fix this issues, first of all, open your Control Panel, go to the options of Power. You can get there in Windows 10 by right-clicking on the start menu and choosing the options of Power. Next to your current electricity plan, click Change Plan Settings. "Put the computer to sleep" should be changed to "Never."
Read more here:- https://www.datarecovo.com/windows-10-sleep-mode-not-working-fixed/