Just like a Windows PC the basic idea is to make a backup of your systems HD (Apps & Data). You don't want to dependent on a single copy of your apps & data as you never know when your system might get stolen, damaged by a natural disaster or fire. One can use a backup program like Apple's TimeMachine to achieve this.
Often one has an external disk which is bootable (just like one does in a Windows PC). In the more current systems one has a recovery partition to re-install the OS or repair it if needed (just like in Windows PC systems). This allows one to cleanup and repair ones HD or SSD.
As for a diagnostic program to diagnose a hardware failure. Depending on the series of system you are working with you can access via the recovery CD/DVD that came with the system Apple Hardware Test (AHT). In the newer models you can launch it by a Startup Key Combination.
There are also 3rd party applications and tools which you can use to help manage your hardware and software. These 3rd party tools are also common in Windows PC's as well.
Bottom line here: You can achieve the same results with Mac's running OS-X as you can do with Windows based PC's.