Obviously, opam upgrade
doesn't work because it's for the installed packages only, not for opam itself.
The first link in the Google search is deprecated and doesn't help.
The latest doc describes it in this part of the documentation.
You just have to run this command in your console :
bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)"
This works on
Linux (amd64, arm64, arm7, i686)
macOS (amd64, arm64)
FreeBSD (amd64)
OpenBSD (amd64)