Write an article based on this summary:

Set yellow sticky traps out. Set out a trap for adult flies. Try cinnamon to kill the larvae. Use pyrethrin spray. Try biological controls. Use diatomaceous earth.
These can be found in any garden center. Egg-laying adults will be attracted to the yellow paper and then get stuck. Place several sticky paper traps in your potted plants or garden. Remove the traps when they are covered in flies and they will be unable to lay eggs. Vinegar (or beer) will attract and kill adult gnats. All you have to do is set out a few homemade traps.  Pour ordinary vinegar (or beer) into several jars with lids. Add a few drops of dish soap to the liquid. Close the lids and poke several holes into them. Leave the jars scattered throughout the area infested by gnats. The adults will fly into the jars and die. Cinnamon is a natural fungicide. It will kill the fungus that the larvae feed on, essentially starving them to death. Simply sprinkle cinnamon on the surface of the soil in your potted plants or garden beds. A variety of pesticides containing pyrethrin are available at gardening and home supply stores. These can kill adult fungus gnats, but not larvae. Since fungus gnats breed rapidly, new adults will appear each day. This means that you will have to repeat sprays every day for several weeks to control the gnats.  Pesticide sprays containing bifenthrin and cyfluthrin can also work. Always follow the instructions and safety recommendations provided with the pesticide spray. A variety of other organisms, such as nematodes (roundworms), rove beetles, and certain bacteria will kill fungus gnats or their larvae. These are commercially available and sold as gnat, mosquito, or fly controls. Place a thin layer of diatomaceous earth—a naturally occurring sediment—over top the top of your soil. A layer about 1 inch (2.5 cm) thick will prevent gnats from laying eggs in your soil. D.E., as it’s known, can be purchased at any plant supply store or nursery.