Zend certified PHP/Magento developer

How do I eliminate errors? – zprofile no such file or directory – macOS

I met the errors with .zprofile. I see this one every time I open the macOS terminal.

Terminal

/Users/leo/.zprofile:6: no such file or directory: /opt/homebrew/bin/brew
/Users/leo/.zprofile:7: no such file or directory: /opt/homebrew/bin/brew

Inside .zprofile shows:

# Setting PATH for Python 3.11
# The original version is saved in .zprofile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.11/bin:${PATH}"
export PATH
eval "$(/opt/homebrew/bin/brew shellenv)"
eval "$(/opt/homebrew/bin/brew shellenv)"

I’ve found similar questions and they recommend editing the .zprofile but I don’t understand what exactly. Maybe there are other solutions to avoid this error displayed in the terminal or what I need to delete/edit?