Having a button to toggle your mic on and off in Discord can be useful, it's also very easy to do.
Firstly, enter your user settings. You can do so by clicking the wrench in the bottom left-hand corner of the screen:
Secondly, navigate to the "Keybinds" tab in the left menu. Then press the "Add a Keybind" button. Next, select the action "Toggle Mute" from the action dropdown menu. Finally, press "Record Keybind" and hit your desired key (or comination of keys). The next time you press that key, your microphone mute will be toggled.