While adult fungus gnats don’t harm plants, their larvae can feed on roots and stunt plant growth. For Haworthia seedlings which are grown in a humid environment, larvae can damage the whole roots and kill the plants. Fungus gnats are often tied to decaying plant tissues and decomposing organic growing mediums. Also pay attention when using grow lights, as adults are attracted by light.
For a heavily infested plant, clean as much of the growing medium out of the roots, even this may tear off some roots. The growing medium removed should be discarded. Remove any rotten plant tissues, and soak the plant in a 1% hydrogen peroxide solution for ~15 minutes. This kills any fungus gnat larvae and eggs, and fungi which feed larvae. Rinse the plant in water and let it dry out in a cool and shaded place. After that, follow the rooting process to let the plant recover.
For a lightly infested plant, mix 1% hydrogen peroxide in the solution in the next ~3 waterings. And for the remaining adult fungus gnats, place yellow sticky traps next to the plants to capture them.
Using an inert growing medium which is resistant to decomposition is an excellent preventative measure.