Hot Corners are one of those Mac features I want to love. Shove the pointer into a corner of the screen and something happens: Notification Center opens, the screen locks, the screen saver starts. The trouble is that you also hit those corners when you’re just reaching for a menu or a scroll bar, and then the screen locks while you’re halfway through a sentence.
The fix is hidden in the setup screen. Hold a modifier key while you pick the action, and that corner only fires when you hold the same key. Here’s the path:
System Settings > Desktop & Dock > Hot Corners
(hold Command, Shift, Option or Control while you open a corner's pop-up menu)
You may need to scroll down in Desktop & Dock to find the Hot Corners button. Then click the pop-up menu for a corner, keep the modifier pressed, choose the action and click Done. You can use any combination of Command, Shift, Option and Control, and each corner can have its own.
My example: set the top-right corner to Lock Screen with Command held down. Now flicking the pointer up there by accident does nothing, and Command plus a flick locks the Mac when you walk away from your desk. Same idea works for Apps or Notification Center in the other corners.
One thing to know: on a fresh Mac the bottom-right corner is already set to Quick Note, without a modifier. If little note windows keep popping up when you aim for the Dock or a scroll bar, that’s why. I’d give that corner a modifier as well, or pick a different action for it.
Further reading: Use hot corners on Mac (Mac User Guide)