macOS – lock your machine

To lock your machine when leaving your desk, you can use Control + Shift + Eject (if available)

Source:

https://www.cnet.com/how-to/7-ways-to-lock-your-macbook/