The networking issues involved require opening TCP/UDP ports and enabling Port Forwarding on the Router of the network that holds the -to-be-shared Mac. if you did this manually, then you could set up Secure Shell (ssh) login from remote devices, which would give you a Terminal window (only).
--------
Mac Screen Sharing with
System Preferences > Sharing > Screen Sharing
... works OK on a locally connected Mac. I use it to see my basement Server screen in a window on my upstairs Mac display. it is considered too slow to be used off-network. Because it is the SAME network, no port forwarding is required.
--------
TeamViewer is the most frequently suggested well-behaved package that could provide "presence" on a remote Mac, and it could likely do all the port opening for you automatically. I have not run it personally.
TeamViewer Remote for Mac is a powerful and user-friendly software that allows you to remotely access and control any Mac computer from anywhere. Whether you need to provide technical support, collaborate with your team, or access your own apps and files, TeamViewer remote desktop for Mac lets you do so securely and efficiently. You can also transfer files, chat with your contacts, and switch between multiple screens with ease.
https://www.teamviewer.com/en-us/solutions/use-cases/remote-desktop/mac/
.