Clean your trash can. Flies are drawn to trash. If you keep your trash can outside, make sure you clean it regularly (liquids often soak through trash bags and stick to the bottom). In addition, consider double-bagging the trash and bringing it into your garage when not in use.
Clean up your backyard. You may be amazed at what you find in your backyard (dog feces, orange peels, food wrappers, candy from last year's Easter egg hunt). You will be less likely to have flies if you remove anything that flies might eat or lay eggs in.
Increase the air flow through your backyard. Flies do not like windy areas. You can increase the air flow by cutting your grass short and trimming your trees and bushes.
Get rid of moisture in your backyard. Flies like moist areas. You can remove moisture by clearing away low-lying brush and vegetation (such as wet leaves). In addition, get rid of any standing water. This might include water that has collected in old tires, planters and fountains.
Spray outdoor surfaces with fly repellent. Popular brands include Suspend and Demon WP.
Set up fly traps around your backyard. There are several types of fly traps, including poison pellets that can be spread around your yard and small bags that can be hung. These bags allow flies to enter but not exit.