How to install/run Mac apps temporarily or in containers
Prefer using Homebrew and Homebrew-Cask whenever available.

For GUI apps, prefer using brew cask zap app_name instead of standard brew cask uninstall app_name.

Excerpt from man brew-cask:

zap token [ token ... ]
    Unconditionally remove all files associated with the given Cask.

    Implicitly performs all actions associated with uninstall, even if the Cask does not appear to be currently installed.

    Removes all staged versions of the Cask distribution found under &lt;Caskroom_path&gt;/token.

    If  the  Cask  definition  contains  a zap stanza, performs additional zap actions as defined there, such as removing local preference files. zap actions are variable, depending on the level of detail defined by the Cask author.

    zap may remove files which are shared between applications.


Running apps from DMG isn't a safeguard as residual files may still be left in ~/Library and other places depending on the app.

AppCleaner works fine almost all the time.

To keep your Mac responsive and free from unnecessary files occupying disk space, make it a point to install apps via above mentioned approaches and remove them as soon as you are done trying them out. This will keep you from resorting to performing a fresh operating system install frequently.

CCleaner is quit effective in getting rid of unneeded files.

However refrain from installing MacKeeper as it is widely considered to be a malware and hard to get rid of.