Using the Maintenance utility
Although there are daily, weekly and monthly maintenance scripts in macos, no clue as to what they do is given and there are no options. You might prefer to use a free utility called Maintenance (titaniumsoftware.fr/en/maintenance.html).
There is a different app for each version of macos, so make sure you download the right one and use it to clean up and solve any current problems.
1 Look for updates
Before using the Terminal command to search for updates check the Apple menu. This lists updates of all types: macos, built-in apps and apps downloaded from the store.
2 Maintenance options
Click ‘Options’ to see even more options for cleaning caches and other items. The default settings are fine, but if you are an expert you can fine-tune the options.