/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Paste the above command in a macOS Terminal or Linux shell prompt. It will clone the brew git repository for you.
Once the clone is done you will get something as shown in below image. Don’t worry of the warning (Warning: /opt/homebrew/bin is not in your PATH.)
Follow the commands that are mentioned in ===> Next steps:
Post running both the command configure the brew installation by checking the brew version
Excellent ! You have successfully installed brew on your macOS.
For more details please visit official website https://brew.sh/
Let me know in case of any challenges in the comment section.