Switched power supply capacitors
Electrolytic capacitors are usually specified as &quot;so many&quot; hours at such and such a temperature. From that and the operating environment you can predict how long it takes for the capacitor to have degraded to the limit values specified in the data sheet. So, if the capacitor doesn't have a data sheet that contains this: -

Temperature value
Operating hours at that temperature
End of life specification

Then they are probably trashy capacitors and should not be used.
The operating hours might be 2,000 h and, quite a few are good for 10,000 h but, 10,000 hours is still only 1.14 years so &quot;what's the trick&quot; you might ask. It's the operating temperature. A capacitor might be rated at 10,000 h at 105 °C but at 95 °C the operating life (or endurance) will be twice as long and, at 85 °C it will be 4 times as long.
$$\boxed{\text{Every 10 °C reduction doubles the endurance period}}$$
Operating at half the rated voltage for its lifetime will also deliver a lifetime extension of 2.
$$\boxed{\text{Halving the applied voltage compared to rated doubles the endurance period}}$$
But electrolytic capacitors will degrade and you have to decide how much your circuit is affected by the degradation and if the circuit can cope with the degradation quoted in the data sheet for the &quot;end of life&quot;.
See also this answer for more details.

Second how will affect a bad electrolitic capacitor on the input of
the PSU? And how will it affect if the bad capacitor is on the output?

If you can avoid electrolytics then you get a certain improvement but if you design your power supply assuming end-of-life degradation levels then you are also good to go. For an undisclosed generic power supply with no details of its design it's impossible to generalize without doing a full reverse engineering of it.