A full blog post with all the steps listed out can be found here. Macs are built on Unix and as such, you can use the terminal to run commands. However, by default root is disabled. This video will show you how to enable root on mac so you can run commands as sudo.
Click the apple symbol the upper left of your screen.
Click System Preferences
In the screen that appears click Users and Groups.
Click login options and then click the lock to allow you to make changes.
In the screen that appears enter your username and password.
Click Join next to Network account Server.
Then click Open Directory Utility.
In the screen that appears click the lock to allow you to make changes.
Enter your username and password.
Now at the top of the screen click edit & then Enable Root User.
Enter your root password and then click ok.
You can now run commands as root from the Mac Terminal