How to sync the GitHub code with the editor

I cannot sync the code on GitHub with my editor which is Pycharm. This means that once I import the code on pycharm to GitHub, they separately work in their own place. In other word, my point is to edit a file in one platform and remain the same and synced in another platform with only one account. How to address this ? Thanks for your assistance…

make sure to have downloaded the latest version.
or use VS code with works great with python

If the repository is public, you can pull before working on it locally.
It will automatically be updated to latest version.