First make sure to go into an acocunt that allows priviledged access to sudo. In this case for me it's not my normal restricted user tin.pham account, but setup.admin,
And follow the install instructions at Homebrew.
Updating Homebrew may result in error if you do it in between Mac OS X updates,
In this in case using the chown is no longer possible with Mac OS X "High Sierra" 10.13.4 and you will receive the following error,
Instead just uninstall,
Ignore the note about the folders to delete. I my example remotdesktop was generated by another program. No idea why Homebrew would tell you to delete folder other program's create.