You have a specific program or process in mind? Without knowing specifics we wouldn't know. Basically I use ccleaner(just the regular cleaner, not the registry cleaner part of it) and malwarebytes. If you dont want ccleaner to remove the cookies for your most used websites, you'll have to set it so it won't. What operating system are you using?
NO! NO! NO! Do not use ANY 3:d party "cleaners" at all...
If you like to erase unnecessary files from your harddrive all you need to do is to type: diskcleaner in the search-field next to your start-menu
Select to start diskclener as ADMINISTRATOR. Thus you get the option to erase old windows update-files (often removes several Gb in one go!)
Diskcleaner is made by Microsoft FOR use in Windows.. Totally safe and wont erase any "wrong" files etc..