Practice proper  sanitation

Empty trash cans and clean  regularly

Flies like to eat the  following: Garbage Meat Rotting veggies Pet food

Use fly swatters  and ultra sonic pest repellers

Use window  screens

and keep doors  closed