The problem: on my M2 mac mini with a Logi Ergo MX bluetooth mouse, every time I make the mac mini to sleep, it immediately wakes up, which I guess is caused by the mouse. So I need to turn off the mouse first, then use keyboard shortcuts to make the mini sleep.

The steps:

System Settings –> Keyboard –> Keyboard Shortcuts … –> (Left panel) App Shortcuts –> “+” –> Select “Application” as “All Applications”, “Menu Title ” as “Sleep”, and “Keyboard Shortcut” as what key combination you press, e.g. Shift + Option + Command + S