Macs run all that stuff automatically. There is no need to do it on your own. But in you insist look into OnyX. Just be careful with it. You can break things easily with it.
Although it's not free (sorry) you might want to try CleanMyMac. There's a trial version but you can only clean so much with it before it stops working, and the full version is paid so it's probably not useful to you. But you can do a lot with it.
I run OnyX about once a month just for peace of mind. All I use is the Automation tab and I check off only Repair Permissions and Execute Maintenance Scripts.