cd into the directory that contains your Python script (as an example I'm using the Downloads (Downloads) folder in your home (~) folder):
cd ~/Downloads
Run the script using the python3 executable
python3 my_script.py
You can also skip step 3 and give python3 an absolute path instead
python3 ~/Downloads/my_script.py
Instead of typing out that whole thing (~/Downloads/my_script.py), you can find the .py file in Finder.app and just drag it into the Terminal.app window which should type out the absolute path for you.
If you have spaces or certain other symbols somewhere in your filename you need to enclose the file name in quotes:
python3 "~/Downloads/some directory with spaces/and a filename with a | character.py"
or o Open the search bar on your mac and enter python a window will open with the address of the directory copy the directory and paste it into the terminal
enjoy