In Zsh, PATH controls where the shell searches when a command name is typed without a full path. Adding a personal directory such as $HOME/bin lets scripts and local tools run like ordinary commands while keeping their files under the user's home directory.
A temporary export affects only the current shell process. A line in ~/.zshrc loads for new interactive Zsh terminals, which is usually the right place for command-line tools that are used from terminal sessions.
A small path-check command proves lookup through PATH before the change is kept in the startup file. Remove that test command after verification if it was created only for the check, and keep system directories first when a local command should not override a packaged one.
Related: How to manage PATH with the Zsh path array
Related: How to configure Zsh startup files
$ mkdir -p "$HOME/bin"
#!/bin/sh echo path-check-ready
$ chmod +x "$HOME/bin/path-check"
$ print -r -- $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ export PATH="$HOME/bin:$PATH"
Prepending makes commands in $HOME/bin win over matching commands later in PATH. Append the directory instead when system commands should take priority.
$ command -v path-check /home/operator/bin/path-check
export PATH="$HOME/bin:$PATH"
Use ~/.zprofile instead when the value must be present for login shells before interactive settings load. Related: How to configure Zsh startup files
$ zsh -n ~/.zshrc
No output from zsh -n means Zsh parsed the file without finding a syntax error.
$ zsh -ic 'command -v path-check' /home/operator/bin/path-check
$ zsh -ic 'path-check' path-check-ready
$ rm -f "$HOME/bin/path-check"