Apple - Is there a quick way to lock my Mac?
On macOS High Sierra, there is a standard key sequence and Apple menu item to lock your screen.
- Control-Command-Q or ^+⌘+Q
For older OS, ⇧+⌃+⏏ puts the display (only the display, not the whole computer) to sleep and will then prompt you for a password if you have enabled Require password [amount of time] after sleep or screen saver begins
under System Preferences > Security
.
If your Mac does not have an ⏏ (eject) key, you can use ⇧+⌃+⌽ (power).
From my answer in Super User.
Using Keychain Access's Lock Screen menubar.
Activate it here, in Keychain Access.app's Preferences:
Then lock.
Via the Expose system preferences panel you can set a "hot corner" of your monitor that activates your screen saver. Say you set the Bottom Left corner, as soon as you move your mouse there the screen saver will invoke. If you've set a password on it, bingo, done.
Yet another option is to enable Fast User Switching in the Login Options pane of the Accounts preferences panel. This puts a Users menu in the top right hand corner, from which you can quickly choose "Login Window...". This kicks you to the login screen, requiring a password to move away from, and also does not end your session/quit any running apps.