Scenario: You are using the MacBook (with macOS Big Sur 11.6) for the first time and you wanted to install "brew" (or) "wget" (or) any other command-line utility
Let's consider user name is "webuser" and you wanted to make this user part of a "wheel" group to execute sudo commands. Use the command "dseditgroup"
$ (Run the command as root user in macOS)
$ dseditgroup -o edit -a webuser -t user wheel
o: Operation - read, create, edit, delete , checknumber
a: Name of the record to be added to the group specified by group name
t: Type of record to be added to or deleted from group specified by groupname. Valid values are user, computer , group or computergroup
wheel: groupname