How can I stop recurring breast infections?

Breastfeed. Hard to control completely, but mastitis (an infection in the milk production glands) can be improved (and possibly avoided) by emptying the milk ducts completely. When infection is detected, pump or feed frequently in the affected area. Don't blame yourself, however, if you end up needing antibiotics - which can happen despite excellent emptying of the breast.
Empty often! Several different steps will help. First, nurse often. Rapidly flowing milk is least likely to produce/sustain infection. Stagnant, warm body temperature milk that isn't flowing is a great place for bacteria to thrive -so empty them out! Keep nipples clean, but not so much that they dry out and crack - this too can lead to infection. Check baby nursing postion. Keep yourself healthy and rested.