Press Control + Command + Q
Click the Apple menu and choose Lock Screen
Press the Touch ID button if your MacBook has one
Set your MacBook to require a password immediately after sleep or screen saver starts
Close the lid to put the MacBook to sleep and lock it if configured that way
