On Linux, macOS and Unix to display the groups to which you belong, use:
id -Gn
which is equivalent to
groups
utility which has been obsoleted on Unix (as per Unix manual).
On macOS and Unix, the command
id -p
is suggested for normal interactive.
Explanation of the parameters:
-G, --groups - print all group IDs
-n, --name - print a name instead of a number, for -ugG
-p - Make the output human-readable.