1) if you're on linux/mac, you have to change file permissions (chmod) to make it executable, then add the so-called shebang line at the start of your file, e.g.:
You'll most likely also have to look up how to set the PATH variable on your system to enable python.
2) on windows, you create a shortcut to your python.exe, then edit it in order to append the path to your filename.py.
I recommend looking it up if the concept isn't clear to you, since it's hard to explain without screenshots/video.
3) alternatively, use this from cmd/terminal to create an executable:
pyinstaller filename.py -F
note that -F creates a single file instead of a folder containing multiple files. you can also append "-i filename.ico" to give it an icon.
for further information, I recommend the pyinstaller documentation.
Note: option #3 will create an application that runs on any computer, even if python isn't installed. the other options obviously require python installed on your system.