By default root user is disabled on Mac, you need to follow below steps in order to enable/disable or change password for root user on Mac.
1. From top left hand side, choose Apple menu > System Preferences, then click Users & Groups (or Accounts).
2. Click the lock icon , then enter an administrator name and password.
3. After you unlock the lock. Click Login Options, right next to home icon.
4. Now Click Join (or Edit), right next to Network Account Server. Now Click Open Directory Utility.
5. Click lock icon in the Directory Utility window, then enter an administrator name and password.
6. From the menu bar in Directory Utility: Choose Edit > Enable Root User, then enter the password that you want to use for the root user. You can enable/disable/change password for root user from here.