Answer: I'm not sure your plant can be saved - fungal growth on the stems at soil level indicates overly wet soils, which has probably affected the roots of your plant as well as the foliage. The fungus gnats you've discovered are feeding and breeding in the wet soil.
If it were my plant, I'd unpot it, remove the growth affected by fungus, repot it in fresh potting soil, and hope for the best. Or, simply toss it and start all over again - some plants will never recover and even if yours does, it may be weak and susceptible to problems in the future.
If you decide to try and save the plant, you can reduce the population of fungus gnats by excluding them from the soil. I use a layer of gravel over the soil surface as a barrier to the pests.
Best wishes with your plant!
Q&A Library Searching Tips