Please go to Documentation. I am listing the MacOs steps as of today:
Install Homebrew.
brew tap azure/functions
brew install azure-functions-core-tools@3
# if upgrading on a machine that has 2.x installed:
brew link --overwrite azure-functions-core-tools@3