Mac: The best way to ensure that nobody tries to open, log into, or otherwise screw around with your MacBook is to make sure that they don't have physical access to your laptop. This isn't always possible.
For example, suppose your hotel room's not-so-secure safe is too small for your large laptop. Maybe you're forgetful. Perhaps you realise it might be a little weird if you ask your significant other to turn around before you tuck in for the night because you need to hide your laptop somewhere in your room. Things like that.
While it's good to be proactive about security and privacy, it's hard to be perfect. And for those moments when you accidentally - or purposefully - choose to leave your MacBook lying around, an app such as Do Not Disturb can give you a little extra peace of mind by sending you a quick notification whenever someone tries to mess with your hardware.
No, not that 'Do Not Disturb'
While its name might be a little misleading, since this open-source app doesn't help you block notifications on your MacBook, Do Not Disturb is a great, lightweight tool to track "lid open events". Sure, a person could just break into your room and walk away with your laptop, but if they're trying to be all super-spy about it, they will pop open the lid, break through your security, copy important data, and leave it sitting exactly where it was. You'll never know.
With Do Not Disturb, you can link the macOS app to a separate iOS app (that demands a $1.49 monthly subscription) to receive alerts whenever someone opens your MacBook. Yes, that means the utility will trigger when you open your MacBook's lid if its running in the background. And, yes, that means you'll have to physically shut your MacBook, rather than letting it go to sleep with the lid wide open, if you want to know when someone else tries to mess with it.
If you a receive a warning from Do Not Disturb on your iOS device, you can have a little fun. That includes telling your MacBook's built-in webcam to take a picture (or many pictures) of the interloper and shutting down your MacBook from afar. The latter won't help much if someone then walks away with your MacBook, but you can always use Apple's built-in tools to find and/or wipe it, at least.