I bought a couple of these for around the house. https://a.co/d/5vjsVs3 Works very well but mostly at night.
Also to make sure you regularly do the dishes, take out trash and clean up any food sources for the flies. After using the above and doing the above, mine went from insanity to maybe 1 or 2 around the house in about a week or two.