I recently built my first rig and been using the hdmi cable that came with the MSI Optix G24C6 144hz monitor, which should be 1.4b. But now I remembered that the monitor is G-Sync compatible. Through googling I found out that majority prefers display port over hdmi but since I don't have DP, I'm not exactly sure if it's worth it (and hdmi 1.4b seems to support 144hrz anyway).
What exactly does G-Sync do and should I get the DP for it?
If you don't have an Nvidia GPU you can't use GSync. You can use FreeSync if you have it but variable refresh rates need at least HDMI 2.0.
What it does: your monitor relays a certain refresh rate to your gpu and if you turn on VSync, your gpu will not render more frames than your monitor can display. GSync and FreeSync make the monitor able to relay different refresh rates, making it possible for your gpu to render less frames whilst still showing a consistent picture.
So in short: if you don't have a DP on your monitor you can't use variable refresh rates anyway and GSync is out of the question.
I've looked up your monitor specs, if you really want to you can use FreeSync over displayport. It'll require some setup in Windows and in your games.
To be clear: hdmi 2.0 is not a cable spec. The ports on both your gpu and your monitor can have a hdmi spec like 1.4 or 2.0 or 2.1. Cable specs are High Speed, Ultra High Speed or Ultra High Speed with Ethernet. Essentially they all work with all hdmi port specs.
Similar goes for displayport except the main cable just has one spec. Your monitor has HDMI 1.4 (no vrr) or DisplayPort 1.2.
Your gpu does HDMI 2.0 and DisplayPort 1.4.
They are backwards compatible but the default to the lowest spec, so connecting HDMI means you can only use HDMI 1.4 spec and connecting DP means you can get DP1.2.
DisplayPort has a much higher bandwidth. Without going into detail I'd say for PC gaming DP is always better. Look up HDMI vs DP for more on the subject.