Your Mac refuses to sleep and you have no idea why. macOS can tell you.
Programs can ask the system not to sleep. That request is called a power assertion. pmset has a mode that lists them, per process.
pmset -g assertions
The man page describes it as a summary of power assertions that may prevent system sleep or display sleep. Look at the process names in the output. A video call, a download manager or a backup tool will usually show up there, and then the mystery is over.
For example, run it when the lid is open, the screen is dark and the fan is still spinning. If a browser or a meeting app is on the list, close it and run the command again to see the entry disappear.
One caveat. The command only reports. It does not tell you whether the assertion is justified, so do not quit a backup halfway because it is on the list. Also, a quiet list means something else is going on, such as a USB device or a setting in System Settings.
I like this one because it turns a vague feeling (the Mac will not sleep) into a name you can search for. Once you know the process, you can read its settings, quit it politely or accept that it is doing its job.
Further reading: pmset.1 man page, On this site: pbcopy puts the output of any command on your Mac clipboard, On this site: caffeinate stops your Mac from sleeping while a long command runs