macOS includes a task manager (launchd) that automates the cleaning of your computer by running the "periodic" utility. This utility runs BSD standard scripts that perform many maintenance operations.
You can use the Maintenance toolbar item to run all maintenance scripts at once.
You can use the Utilities > Scripts pane to individually or simultaneously run the scripts. The lower section of the Scripts pane of the Utilities toolbar item manages the logs of maintenance scripts. You can show the contents, the path, and the size of each log. You can also individually or simultaneously clean the logs.
The Clean and Clean All buttons delete the contents of logs but don't delete the files. If the Clean button is dimmed, this means that no log is selected or the selected log doesn't exist. (The corresponding scripts have probably never been executed.)