Type “terminal” into Spotlight Search (CMD+SPACE).

Once you have your terminal opened, paste this command:

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Once the script is done, you need to add Homebrew to your PATH. The following command will append ‘eval “$(/opt/homebrew/bin/brew shellenv)”‘ to your z-shell profile.

Remember to replace username with your actual username:

$ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/username/.zprofile

Finally, paste and run this second command into your terminal:

$ eval "$(/opt/homebrew/bin/brew shellenv)"

Homebrew basics:

The homebrew command; type the command brew into your terminal:

$ brew

Example usage:
  brew search TEXT|/REGEX/
  brew info [FORMULA|CASK...]
  brew install FORMULA|CASK...
  brew update
  brew upgrade [FORMULA|CASK...]
  brew uninstall FORMULA|CASK...
  brew list [FORMULA|CASK...]

  brew config
  brew doctor
  brew install --verbose --debug FORMULA|CASK

  brew create URL [--no-fetch]
  brew edit [FORMULA|CASK...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew

Installing tools. Lets say you want to install wget:

$ brew install wget

Or maybe docker:

$ brew install docker

Updating Homebrew is done with the command brew update. Note that this will only update Homebrew itself, not the packages. To upgrade your packages type brew upgrade.

$ brew update
$ brew upgrade

You should also run the commands autoremove and cleanup. This will remove your system of unwanted packages no longer in use.

$ brew autoremove
$ brew cleanup