1. go to https://www.pyinstaller.org/
2. install PyInstaller from PyPI
pip install pyinstaller
3. run pyinstaller --onefile -w if you want only one output file and without opening console terminal
pyinstaller --onefile -w yourscript.py
4. (for windows) if your program requires additional packages, you can use NSIS (Nullsoft Scriptable Install System) https://nsis.sourceforge.io/Main_Page. download and install it. (watch video above to see how to do it properly).