S.M.
Gnats often come in the potting soil you buy. Throw out any potting soil you have because it is probably infested with gnat eggs. The best way to get rid of them is to repot them in fresh potting soil. If you don't, every year you will have a new crop of eggs hatching and a new infestation of gnats.