Locking your screen while you’re away from your computer is common on a Windows machine, but sometimes Mac users aren’t aware they can do the same thing.
If you want to protect your screen, then the best way is to use the shortcut in the Keychain Access menu. First, go to Applications, then Utilities, and then open up the preferences window. You should be able to click a box for “show status in menu bar”.
After that, return to your main screen. You should be given an option to lock your screen.
If you want to add a password after waking your computer up, then go to “system preferences” and then “security”, and then tick the box “require password after sleep or screen saver begins”.
And then you’re all set to go – just don’t forget the password!