Mac's don't need defragging as OS X automatically writes 2Gb or below sized files to one contiguous space on the drive. https://azkrmj.weebly.com/blog/dr-cleaner-for-mac-in-cnet. There are certain cases where's it's needed to free up a large spaces on the drive, but not something everyone has to do.
Far as other Mac maintainence, there really isn't any except to backup one's files regularly. Keeping Software Updated and run a web browser check to make sure the plug-ins are current.
CCleaner for Mac! Clean up your Mac and keep your browsing behaviour private with CCleaner, the world's favourite computer cleaning tool. Free download. Oct 09, 2019 With macOS Mojave’s release just around the corner, MacPaw’s CleanMyMac X launches today as the best whole-system cleaner around — a Swiss Army knife of simple tools that radically slim a Mac’s software footprint, improve performance, and augment Apple’s existing malware protection. The world's most popular PC cleaner It protects your privacy and makes your computer faster and more secure New Feature: Software Updater keeps your apps updated, to reduce security risks and save you time. AppCleaner is a small application which allows you to thoroughly uninstall unwanted apps. Installing an application distributes many files throughout your System using space of your Hard Drive unnecessarily. AppCleaner finds all these small files and safely deletes them. Download this app from Microsoft Store for Windows 10. See screenshots, read the latest customer reviews, and compare ratings for Total PC Cleaner - Free Disk Space Clean Up, Optimize Memory & Windows System.
For Safari and Flash, this check is more accurate
Most of those cleaning programs are junk, especially MacKeeper.
Free Computer Cleaner Mac
If your friend got onto your computer and visited a bunch of adult sites, then I would recommend something like OnyX, doing ALL the cleaning and maintenance aspects and rebooting, perhaps followed by a Disk Utility Erase free space.
CCleaner beta is out for OS X, used on PC's and combines cleaning and scrubbing of the drive if setup correctly.
Ccleaner
If your interested in performance, read my post here