I found that the best insectide is soap and water sprayed directly onto plants or sit a bowl of soapy water out. The gnats will be drawn to the soapy water and drown.
Dusts that contain Diazinon and sprays that contain Pyrethrins will be your best bet. Pyrethrins will kill on contact while the Diazinon dust is used to control future hatchings.
Fungus gnats on houseplants can be managed by letting the plant dry between watering. If this doesn't work Pyrethrin sprays can be purchased at a garden center. You can also use pheromone traps. Outdoors try products that contain cypermethrin.
Insecticides such as Malathion and Diazinon work well in eliminating gnats, these chemicals must be applied to the soil in most cases, and may potentially cause damage to plants.
There are a few different options for insecticides. You could use Diazinon or Malathion to treat soil surfaces. You could also use an aerosol insecticide to spray in the air and on the soil.
For a cheap home made spray that is more non toxic then most you can make a soap or tea spray. Get an empty spray bottle and mix water with a little dish soap. Or boil tea leaves in water and add a little dish soap to the mixture. You will not need to worry about kids and pets.