A Normally Closed Momentary Switch (NKK) - Very cheap and tiny, on Amazon: XLX 50pcs Red Cap 7mm Mini Lockless SPST Momentary Micro OFF Switch 2 Pin Push Button ( AC 120V/6A or AC 250V/3A ) Assortment Kit -- less than $13 for 50 of them. Small enough to hide near the mic end and depress with your off hand, or create a pedal version by mounting the switch inside a wooden block or rigid project box. You don't want to mount the switch in such a way that you would break it with your foot weight, so make sure it sits slightly below the box at the right height such that the box would take the brunt of the weight.
Alternatively, for a few dollars each, SPST Momentary Foot Switch - Normally Closed - Soft Touch - Short Shaft - Pre-Wired -- this is available and designed for using your foot. I found it on "Love my Switches"
In an XLR cable, you simply pick a wire that is not ground. In an XLR cable there are three wires, ending in 3 pins. In a female XLR, the top right is ground, and the other two are signal. In some cables, the red wire and black wire carry signal, white is ground, in others red and white carry signal and black is ground, since it was up to the cable manufacturer. you can test this at one end. In a male XLR everything is swapped left for right, so the top right is ground. Video of someone doing it: https://www.youtube.com/watch?v=rS1gZ7zbvsM
In a 3.5mm, you have 3 or 4 wires depending on the plug. For example, this one has wires for both a mic and a headphone: https://www.digikey.com/product-detail/en/tensility-international-corp/CA-354S/CP-354S-ND/382910
It is possible to test resistance to determine what wires your microphone is using. The speakers are usually between 80 ohms and the mic is around 1k ohm and apply very light current to determine which is left and which is right channel.
The common assignment of the tip is:
- Tip = blue (left audio)
- Ring 1 (closest to tip) = right audio (red)
- Ring 2 = ground (black/copper)
- Sleeve = microphone (white)
So you would put your NC switch inline in the White wire (usually).
If there is only left/right (for a stereo mic) there are some tricks using a small circuit to get one switch to control two channels, or you can use two switches (one for left and one for right) and either glue something to them so they get depressed at the same time, or hold both buttons to do both L/R. Or, you can get a two-pole (dipole) switch. (The ones I mentioned are single pole).
An example of a multi-pole foot switch is DeMont / Guyatone 3PDT Smooth-Click Foot Switch, Highest Quality Stomp Box Switch