A private message popping up in the corner while your screen is on the projector is the classic way to make a meeting awkward. macOS has a setting for exactly this, and I’d set it once and forget about it.
It’s in the Notification Center part of the Notifications settings:
System Settings > Notifications
> Allow notifications when mirroring or sharing the display: off
With it off, notifications don’t appear while your display is mirrored to a projector or TV, or while you share your screen. Apple’s own example is a Keynote presentation, so others can’t see your notifications while you present.
The same section has two neighbours worth a look. “Allow notifications when the display is sleeping” and “when the screen is locked” decide what shows up when you walk away from the Mac. “Show previews” can be Always, When Unlocked or Never, and When Unlocked is the one I’d pick on a laptop that goes to cafés.
The caveat: this setting is only about mirroring and sharing the display. On a normal day at your own desk, banners still show up as usual. If you also want quiet in a video call where you don’t share anything, turn on a Focus like Do Not Disturb for the length of the call.
Further reading: Change Notifications settings on Mac (Mac User Guide)