By allowing the compost to dry out between waterings, you’ll greatly reduce the fungus gnat population.
When you do water the plant, refrain from pouring water on the top of the soil.
Instead, sit the plant in the sink, or bath with a few inches of water in, or on a saucer of water, from which it can soak up the water through the bottom of the pot using its roots.
You can also try using gravel mulch to help get rid of the flies.
Gardeners World explained: “If you cover the surface of the compost with a one-centimetre thick mulch of gravel, grit or ornamental glass pebbles, this will stop house plant flies from being able to lay their eggs.