How to Get Root Access in Mojave?

Root isn’t what you need, SIP must be disabled if you desire to modify the system files while booted from the same system as the files to be edited.

A centerpiece is the protection of system-owned files and directories against modifications by processes without a specific "entitlement", even when executed by the root user or a user with root privileges (sudo).

https://en.wikipedia.org/wiki/System_Integrity_Protection

macOS Recovery is part of the built-in recovery system of your Mac. First, boot to recovery, then open terminal from recovery and run sudo -s to become root. Then you are clear to make modifications to the normal system on the Macintosh HD volume.

  • https://support.apple.com/en-us/HT201314

You could also run the disable from recovery and restart it you want to opt out of protection indefinitely and not just temporarily.

  • https://support.apple.com/en-us/HT204899

I’m generally not doing that but your system, your call totally.