How to Lock Your Mac with a Keyboard Shortcut
You will have to click on the menu Apple (the little black apple at the top left of your screen) then select System Preferences. You can now click on the icon Security and confidentiality, to finish by selecting the tab General. You just have to unlock the padlock which is at the bottom left.