They are definitely a pain and you need to get rid of them quickly or they just multiply.
Here is a good tutorial: https://www.craftylittlegnome.com/fungus-gnats-houseplants/
You need to let any damp surfaces dry out since they are attracted to water.....
Hi, put out a dish of vinegar and top it off with a few drops of dish liquid soap. works everytime
Hi Natasha: I use a small plastic bottle, cut the top off, about 1/2 inch from where it starts to go towards the top, remove the cap and turn this part upside down and stick it into the bottom section of the bottle. Then, put some vinegar in it, a drop of dish soap and a piece of fruit. Make sure there is a gap between the opening and the liquid. They will go for the fruit and drown. Good luck