intermittent compressor on elderly dual-fuel heat pump
The capacitor adds a boost for the initial startup of the compressor and fan. It can sometimes intermittently fail before going bad entirety. The only way to know for sure is to pull it out and test with a multimeter, comparing with the rating on the side. This can be risky since it is a high voltage device and you might not have a working disconnect (make sure it is actually off, since some installers cheat by bypassing it).

Beyond that, this is very doable for a DIY. Just be careful.