Also maybe your $PATH is not well defined. Does the list given by echo $PATH contains the result given by echo $(brew --prefix)'/bin:'$(brew --prefix)'/sbin'? This path should be toward the beginning of the list to be prioritized over system binaries, surely before /usr/bin.

To do so, you can add this at the end of your ~/.zshrc or ~/.bashrc:

export PATH=$(brew --prefix)/bin:$(brew --prefix)/sbin:$PATH

As a result, after opening a new terminal or doing source ~/.zshrc, you'll be able to echo your correct path as:

Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile

I installed some packages via brew. But I can not find where they are.

It seems that homebrew requires one to be explicit with things. Fortunately, a bit of escaping using brew --prefix can make this a no-brainer, for those who need to find the path for the pkg-config utility, e.g.