In such a situation, a unidirectional microphone will pick up your voice but will reject the sound coming at you from the monitor speaker (assuming you’re facing the audience), which is behind the mic. These are really useful for lots of things, including live stage performances where there are monitor speakers pointing up at your face while you sing/speak. Most mics default to picking up sound from just one direction, and are called “unidirectional” mics.
Microphones pick up sound from very specific directions. A microphone with a bi-directional pickup pattern, AKA a Figure 8 mic, is handy in many recording situations, and not so handy in others.