Just option-click the notifications icon in the upper right corner. The icon will dim, signifying that it’s off. Option-click once more to turn it back on.
I also use Vitamin-R for focus when working on my Mac. The app allows me to follow the Pomodoro Technique, but with time increments I define, as well as shut down unnecessary distractions. I also like how it allows you to define the focus of the moment for easy reference in case you get distracted.
In addition, consider creating a new account on your Mac called Focus, where you customize that profile to contain no distractions (e.g. don’t connect your email or social media accounts in that profile). This concept is also useful if you give presentations or demonstrations in public. You can create a streamlined Demo account to ensure your presentation is not disrupted by random interruptions from your Calendar, Email, Task management app, etc.