Follow the below steps carefully and in order. It took me a really long time to set it up correctly after running into several issues. However, the overall process in straightforward. Good luck.
Install hadoop with brew.
$ brew install hadoop
Go into the said directory. Also replace 3.3.6 with whatever version you’re working with.
$ cd /opt/homebrew/Cellar/hadoop/3.3.6/libexec/etc/hadoop
Open the directory on any code editor of choice.
$ code .

the expected list of files
Now, we are concerned about the following files.