KDE Connect has been mentioned before. You can supplement this and other tools by using a VPN so that both endpoints can see each other even if the underlying network does not allow this. My preferred solutions are Tailscale (managed, cloud-based) or Headscale (for self-hosting).
If you do not trust Tailscale as a company, here is an open source re-implementation of the server called headscale. Some/all clients are open source as well. So, you can review all components yourself or pay for a professional third-party review. Otherwise, if you take a binary blob from any origin, including Tailscale, and have it run with privileges on your server, there are few limits on what this blob can do. Yes, backdoors are technically possible, but probably bad for Tailscale’s business if that ever came to light.