Member-only story
This one command will uninstall all the packages install through Homebrew.
brew remove --force $(brew list) --ignore-dependencies
To remove unused archives run.
brew cleanup
To remove Cask packages
brew cask remove --force $(brew cask list)