How do I make sure to use the newest version of Ocaml?

You can also run opam upgrade --unlock-base to upgrade all the packages of the current switch including the compiler.
(by default opam will not change the version of the compiler you are using; the --unlock-base option tells it to lift that restriction)