Here is a good article on that. https://www.tipsbulletin.com/how-to-keep-flies-away/
This is the best information I could find for you: https://www.thespruce.com/getting-rid-of-flies-outdoor-2656268
Lime put it out on the yard you can get it at any farm store just broadcast it out around the yard
Keep the yard raked and cleaned of any debris, especially if you have fruit trees. Keep pet feces picked up. Keep pet feeding areas cleaned and remove food dishes after they are used. Try to determine if there is one particular area that is attracting the flies. Spray the area with insecticides on a regular basis until you've broken the cycle of flies, eggs, more flies.