Trying to get a Mac to automatically sleep after a certain amount of time can be frustrating. Many things can interrupt the process, like network activity and persistent apps. Luckily, you can use a handy tab in Activity Monitor to quickly see what might be preventing your Mac from sleeping. Here's how.

First, let’s open “Activity Monitor.” You can find the app in the Applications>Utilities folder, or you can use “Spotlight.” Click the “magnifying glass” icon in the menu bar or press Command+Space. When a search bar appears , type “activity monitor” and press “Return.”

When Activity Monitor opens, click the "Energy" tab.

On the “Energy” tab, you’ll see a list of active processes (background apps and system functions) with information about their energy impact. Look for a column header labeled “Preventing Sleep” and click on it.

If you see “Yes” in the “ Preventing Sleep ” column , then your Mac will not automatically enter sleep mode while this process is still active. If it’s a process you recognize, you can wait for an active task to complete or try to “quit” the application. If it’s a process that isn’t behaving as you expect or refuses to quit, you can force it to stop .
To force a process to close in Activity Monitor (in any tab), select the process in the list and click the “Stop” button, which looks like a small octagon with an “X” inside.

When Activity Monitor asks you to confirm, click “Force Quit.” After that, if this process was the only thing delaying sleep , then your Mac should sleep the next time you expect it to.
Information source: howtogeek.com
