Yellow sticky traps are sold commercially online or in shops. These are not just great for catching flies but will help you assess the severity of the infestation.
Leaving sticky traps on the surface of the soil will catch the eggs laid by adult flies.
Sciarid fly enjoys a moist environment to live. Ensure not to over water container plants. When experiencing an infestation, it's best to water plants by placing in a saucer of water, letting the roots absorb water from the bottom up. This makes the soil surface dry and unattractive to fungus gnats.
Watering plants too often with unsufficient drainage may result in rotting and fungus gnats will thrive in these conditions. Try to avoid overwatering and check soil dampness before every water.
Use specific house plant compost to help reduce the risk of infestation.
Incorporating perlite or gravel into the soil mixture will help better drainage if your plants are overwatered.
Beneficial nematodes can be added to the soil of house plants.
Hypoaspis miles is the biological control mite, for the larva of Sciarid fly is available to purchase online.
By mixing peppermint, cinnamon and sesame oils and diluting with water, you can make a quick and easy non-toxic spray that will deter flying insects in the house.
Alternatively, you can use a dishwashing soap and water mixture to kill larvae on the soil.