Plants and dirt can sometimes accumulate in your AC unit. A thorough cleaning in this case is all it takes to address any reduction in condenser function.
If a minor part can be replaced, like a relay switch or run capacitor that’s stopped working, that is generally an easy fix. This largely depends on what part is broken, and what type of unit you have.
This requires more extensive repairs, as you will likely have to replace your AC motor, but it’s by far better than a full AC unit replacement. Make sure you hire a qualified professional though, as getting the wrong motor will almost certainly damage your AC unit.
Dirty or Faulty Condenser Coil
A dirty condenser coil can actually cause an AC unit to start running less efficiently. Cleaning is simple and fixes the problem right away. Additionally, if the coil is faulty, while it may be more cost effective to replace the AC unit, it’s possible it could be more affordable to replace if it’s still under warranty.