I had some gnats that came from a bag of soil, which had been stored outside, wet.
I didn't have any of the regular remedies so I just stopped watering and covered the tops of the pots with half an inch of Perlite.
I resumed watering after about a week.
It worked for me, but I would definitely listen to the guys with more high tech solutions, always good to have those things around for emergencies.