As an old hand who was around when homebrew started, I feel obliged to let people know there are alternatives. If you find brew's take-over-your-system-and-youll-thank-me approach off putting, and/or you value stability over the coolness factor, MacPorts is still alive and well (https://www.macports.org), and in-fact has basically all the same packages brew does.
In 18 years of using MacPorts, it's never messed up my system, broken something that used to work or decided that I don't get to run commands right now, because it wants to run an upgrade. (It's also never spied on me.)
The price you pay for that is that more things are compiled from scratch, but hey - you only have to do that once, and it only takes like 20 minutes on a modern Mac. Upgrades are generally pretty fast.
[0] https://devenv.sh [1] https://github.com/LnL7/nix-darwin