Hi @Rahim Molvani,
Thank you for posting in this community.
Option 1: Use OneDrive.
Since both SharePoint On-premises and SharePoint Online can use OneDrive, you can synchronize files from both sides to OneDrive to synchronize files.
You can refer to the link below to configure OneDrive synchronization for SharePoint 2019 and SharePoint Online:
SharePoint2019: Configure syncing with the new OneDrive sync app.
SharePoint Online: Sync SharePoint files and folders.
Option 2: Use SMTP.
This is a free migration tool provided by Microsoft which can synchronize files on SharePoint On-premises to SharePoint Online. and you can refer this document to use SMPT.
But this tool is a one-way transfer, only from SharePoint On-premises to SharePoint Online.
We can only synchronize files on SharePoint Online to SharePoint On-prem by downloading files on SharePoint Online to local computer and then uploading them to SharePoint On-prem.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.