If they really are fungus gnats, your problem is that you have too much moisture somewhere. They breed in sodden medium.

There ARE ways to clean out bugs out of the soil... Google 'soil drench'.

Another way to go is set off 2 bug bombs 3-5 days apart to kill the exposed life stages of the pest. The second one kills anything that was still in egg form and was protected by the first one.