It’s always a good idea to lock your workstation when you leave it, even for a brief minute. On your Apple desktop computer’s system preferences, you can require a password immediately when your computer goes to screensaver or sleep in Security & Privacy:
To immediately put your computer to sleep, simply press control + shift + eject:
If you’re using a MacBook Air that doesn’t have an eject key, consider setting up a screensaver hot corner.
Also published on Medium.