Homebrew is a powerful package manager like apt in Ubuntu. With the help of homebrew you can install packages from the terminal quickly. Run the below command from the terminal to install homebrew package manager.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

To verify that Homebrew has been installed, you can run:

brew info