For me:
1. Buy major manufacturers gun that is proven over time by someone else. Glock for me. But there of course are others.
2. Don't buy another generation gun until it is proven. I'm still running Gen 3 Glock because, well I have two identical G26's.
3. Have a training gun and a carry gun. Run the carry gun for the first year in training.
4. Detail carry gun every year and replace any worn parts.
5. I replace my magazine springs and ammo every year and the Recoil guide when needed on the carry gun.
6. Shoot the carry gun twice a year for a total of 100 rounds.
7. On the training gun I replace the recoil guide every year and let the rest break. Free training when those mag springs get wonky, etc.
After all that if a spring breaks I suspect it was just a bad spring.