gonna be a rough time with living soil...solve the issue simultaneously for all stages of the pests lifecycle...which means you need to attack the adults you are seeing, the pupae you will see in a few days as adults, and most importantly the eggs/larvae.
if the issue is 'bad' right now, then it has been really bad for quite some time...especially if you're thinking you have lost plants to it, then it has been a 11/10 alarm for a while now......mostly going to be relating to your watering habits, but your general OpSec as far as contact to room and soil health are not winning right now
i think the best place to start is fundamentals with the gnats. educate yourself on the stages and your options. You will see that there is no 1-step for this. The complexity you will be scratching the surface on is why most folks cultivating for their dayjob have insane IPM procedures. I mean using twenty dollar bills left and right daily, just to be on top of it when it hits the fan