You may be looking for custom (patented? 3rd party plugin) software that ignores the audio from the open-air speakers in the microphone so you don't get an echo.
The general recommendation you will get is to NOT use speakers outputting sound you don't want the mic to process. Use headphones instead. OR make sure your desktop audio does NOT go speakers (then to mic).
My understanding to avoid echo
- avoid creating audio loop or duplicate (echo) in the first place (so nothing output to speakers, picked up by mic, routed elsewhere.... ie desktop audio going to speakers and OBS, plus mic (which desktop audio speaker output)
win-audio plugin can help with audio routing
or use headphones so mic isn't picking up desktop audio
- use echo cancellation software (which usually needs to be in control of both speaker output and mic)...
Personally, I found it easiest to simply disable Global/Desktop Audio in OBS. Then selectively add ONLY the desired Audio input sources (ie specific application).
the relatively new plugin
https://obsproject.com/forum/resources/win-capture-audio.1338/ may help