Make sure a folder is opened in VSCode and run the following in the terminal:
debugpy file.py
There are some caveats for this to work. Check this link: No-Config-Debugging