1. Use high quality components paying particular attention to power and voltage ratings. Components that are not propperly rated are far more likely to fail prematurely.
2. Ensure that soldering is adequate for the size and purpose of the component, Relays, large capacitors, resistors, transistors etc, and especially connectors that get extra mechanical stress, should be soldered properly. If I had a dollar for every connector I have resoldered on boards such as laptops and power supplies, I'd be able touy everyone here a drink! Wave soldering usually leaves these components with inadequate solder to support them, especially if mechanical stress (copnnectors) or vibration (relays and other large components) is involved. It's worth manually putting more solder on these joints.
Of course these actions are best done at manufacturing, but No 2 can be done as part or preventive maintenance.