This may help you in avoiding it:
1. Keep the water out while you're showering: use earplugs or a shower cap.
2. Protect your ear canals when swimming. Wear earplugs, and resist the urge to take a dip in any polluted waters like ponds.
3. Take special care when cleaning ears. Wipe outer ear clean with a soft cloth wrapped around your finger. You don't want to disrupt the natural wax coating in your ear that protects against harmful bacteria.