How to update Python everywhere on MacOS and have only one version?

I am a bit confused about Python's versions and about how to update them all on MacOS (Mojave 10.14.5). At the moment latest Python version is 3.9.2, if I run Python IDLE I get this very version. But in terminal I have:

python --version
Python 3.8.5

which python
/Users/myname/opt/anaconda3/bin/python

Even if I don't remember to install anaconda and not sure to need it. Also I'd like ipython to use the latest version. I've already read Updating Python on Mac but found no working solution, in fact I got following:

python --version
Python 3.9.2

And ipython:

Python 3.8.5 (default, Sep  4 2020, 02:22:02) 

Then exiting and re-opening the terminal:

python --version
Python 3.8.5

which python
/Users/myname/opt/anaconda3/bin/python

Finally on MATLAB, with:

pe = pyenv;
pe.Version
ans =
"2.7"

Which I don't know where does it come from. How can I have only one working Python version to handle and update (the same version for system, IDLE, ipython and MATLAB)?