If you just want command-line access, you can SSH in.
If you want to use the graphical desktop environment (with a mouse, etc.), you can use VNC to get in. VNC is a fairly universal de facto standard remote desktop protocol with multiple implementations on all platforms. It is also known as the "Remote Frame Buffer" (rfb) protocol. Ubuntu comes with a VNC server called vino that you can set up from the Ubuntu GNOME desktop environment in System > Preferences > Remote Desktop.
macOS's "Screen Sharing" feature is VNC-based, so you can connect to any VNC-enabled device from macOS by selecting Go > Connect to Server… (Cmd-K) from Finder, and entering a VNC URL like vnc://username@host.example.com/. Or you can launch the Screen Sharing client app:
open /System/Library/CoreServices/Applications/Screen\ Sharing.app
…and then use that app's GUI to tell it to connect to your Ubuntu box.