Instructions for a supported install of Homebrew are on the homepage. The script installs Homebrew to its default, supported, best prefix (/opt/homebrew for Apple Silicon, /usr/local for macOS Intel and /home/linuxbrew/.linuxbrew for Linux) so that you don’t need sudo after Homebrew's initial installation when you brew install. This prefix is required for most bottles (binary packages) to be used.