Stop process from preventing sleep on OS X
There are dozens of things that can prevent sleep built into macOS, and third party software can also disable sleep.

The first troubleshooting step is to run this command in Terminal:

pmset -g assertions


That will list the reasons your Mac is not currently asleep. Normally running on battery power you should get:

Assertion status system-wide:
   BackgroundTask                 0
   ApplePushServiceTask           0
   UserIsActive                   1
   PreventUserIdleDisplaySleep    0
   PreventSystemSleep             0
   ExternalMedia                  0
   PreventUserIdleSystemSleep     0
   NetworkClientActive            0

[further details removed for brevity]


Which means the only reason your mac isn't sleeping is due to user activity on the mouse/keyboard.

If you see something else (like PreventUserIdleSystemSleep) then your mac probably won't sleep at all and you should read the other details provided by pmset -g assertions to investigate further.