Method 1: Through the corners. Enter System Preferences.
2-By clicking on the link "Mission Control".
3-By clicking on the button "Corners" (Hot corners, in English),
located at the bottom left of the screen.
4--You'll see a window with the configuration of the four corners of the computer, select the corner you want to use to lock your computer screen, for example at the top right and click on the arrows of the combo (see picture).
5-Choose the "Bring to rest" (in English, Put display to sleep) and click ok.
6-Close all windows (do not ask more confirmations), and we're done. Each time you take your mouse to the top right corner of your Mac (or corner you have configured) will go into sleep mode and need enter the password to unlock it.
If you do not like this method, then we explain another method is to place an icon in the menu bar. Stay tuned.
7-Method 2: Icon on the menu bar. Login to System Preferences.
Click on "Users and Groups".
9-Click "login options". To edit the login options you must unlock the padlock appears in the bottom left of the window. By clicking on the padlock and enter your password.
10-Now you can edit the options. Check the fourth option for the option to lock screen
appears in your menu bar.
11-Choose whether you want to leave the whole name, a short name or icon and closes all windows (no need to save any more).
12-We're done. Each time you want to lock the screen using this method, you only have to go to the icon (short name or long name) that now appears in your menu bar, click on it, and finally click on "Login".