Make sure all fruit and fresh veggies are out of the area, first...
then... put about 1/4 C cider vinegar in a shallow bowl, and put a couple of drops of dish soap in it. Just stir it gently to spread the soap around, but don't make bubbles.
In a few days, you'll have BUNCHES of drowned fruit flies in the bottom of the bowl...
I am having problems with that right now, also..... and have probably 50 or more fruit flies in the bottom of the bowl. My biggest problem is that the bananas are still on the counter, so they keep going back to that. (I don't want to put the bananas in the fridge, though....)
However.... if you brought the flies home from the hospital in plants, they may actually be "fungus gnats" ...... they breed in the moist top layers of potted plants.