I use brew extensively on MacOS. It’s just as convenient as many Linux package managers. What I don’t like, it leaves dependencies after removal of formula. There’s simple way to clean it up by running one command 1.

Uninstall with dependencies
brew uninstall FORMULA
brew autoremove

Info

In my case running brew autoremove actually removed few packages I really wanted to have. Check the output carefully!