If it's fungus gnats: change the watering, not the plant
Fungus gnats are the easiest of the three and the one people overtreat. The larvae need consistently moist organic matter near the surface. Take that away and the cycle breaks.
Water from below where the plant tolerates it, and let the top two to three centimetres of compost dry properly between waterings. Most of our houseplants are overwatered in winter anyway, when light is low and growth slows, so this is a correction worth making regardless. Topping pots with a centimetre of horticultural grit or fine gravel makes the surface an unappealing place to lay eggs and looks tidier too.
Yellow sticky traps pushed into the pot will catch the adults and, more usefully, show you whether numbers are rising or falling. Clear away fallen leaves sitting on the compost — that's a nursery. Expect a couple of weeks for the current generation to die off.
If it's whitefly or mealybug: physical removal first
Whitefly need you to actually look at leaf undersides, every plant, including the ones you've assumed are fine. Isolate anything infested — move it away from the rest, ideally into another room. Then wash the undersides with a soft cloth and soapy water, or take smaller plants to the shower and rinse them firmly. Repeat every few days, because eggs hatch in waves and one treatment never finishes the job.






