Sometimes you're in the middle of typing something, see a notification make its way across your screen, and want it to go away. Immediately. Unfortunately, on a Mac, there's no default way to do that without moving your hand off the keyboard and using your pointer to close it out.
Aliento is a pay-what-you-want Mac app that runs in the background and allows you to set a keyboard shortcut for dismissing notifications. Just launch the application, set a keyboard shortcut (the default is Command+Escape) and you're up and running. iI you don't want to turn off notifications altogether (say, via a Focus Mode), it's a nice half measure: You can note when a notification comes in but clear it from your screen with minimal fuss.
From now on, every time you receive a notification, you can dismiss it using the keyboard shortcut. If you need to see it later, you can also review everything you closed out in the Notification Center. I've had the app installed on my Mac for a couple days and find myself using it all the time. I can see a notification come in, clear it off my screen, and get right back to writing.
You can set the application to start at boot, and decide whether you want it to appear in the menu bar. I like that it can function without cluttering up the menu bar, personally—this is the kind of application you really can just install and then forget about, because it functions like a native feature would.
Speaking of, I wish Apple would launch this functionality as a native feature. The company is pretty good about notification management in general: Focus Mode is very good at reducing distractions, and Apple Intelligence makes it even better. There's also a great tool for seeing iPhone notifications on your Mac. Generally, a lot of care and attention is paid to notifications in macOS, so it's kind of flabbergasting that there's no keyboard shortcut for dismissing them.
Happily, Aliento takes care of this problem so I can stop thinking about it. (The app is free to add to your machine, but if you find it useful, I encourage you to drop the developer a couple bucks as a thank you.)