Mac won’t wake from sleep
If your screen keeps going black and your Mac won’t wake again, it takes several minutes after a key press for the computer to wake up, or you’re being unexpectedly logged out of your user account, first go to Apple Menu > System Preferences > Energy Saver pane. If your Mac’s startup disk is a plain hard drive (not a Fusion Drive or an SSD), disable “Put hard disks to sleep when possible.”
As a temporary workaround, in the hope that Apple fixes the cause of the sleep issues, also set the Computer Sleep slider to Never. Then, go to the Security & Privacy pane, click the padlock and enter an admin account’s credentials. Click Advanced, then uncheck “Log out after [number] minutes of inactivity.”