git fetch downloads changes from a remote repository but does not apply them to your working directory. git pull does both: it fetches changes and merges them into your current branch.
Example Code:
# Fetch changes from the remote repository
git fetch origin
# Pull changes from the remote repository and merge them
git pull origin main