There has been a Stream Deck plugin for checking and setting the mute status of your microphone, but previously it only worked on Windows.
As of version 3.0, it now supports macOS as well.
The benefit of this (vs everything I have seen previously) is that it actively monitors your microphone’s mute/unmute state at the OS-level, so if you mute/unmute it a different way (for example, using Rogue Amoeba’s SoundSource), the change will be reflected on your Stream Deck. Previous options had always required that you only mute/unmute using the Stream Deck, or else it could get “out of sync”.
It also now offers an option for “Push To Talk” or “Push To Mute”.
There are 3 buttons available, as shown here:
The left one shows the current status. The middle one lets me mute my microphone, the right one lets me unmute it.
(The left one is the one that you can set to do Push-To-Talk or Push-To-Mute.)
The plugin is normally available right from the Stream Deck app, or else you can download it directly from GitHub: