Taking someone out of a group should be the easy part, but usermod has no clean option for it. gpasswd -d does exactly that one thing.
Name the user and the group:
sudo gpasswd -d alice docker
id alice
getent group docker
It prints Removing user alice from group docker, and id shows the other groups are still there. With usermod -G you’d have to type the full list of groups the user should keep, and one forgotten name removes more than you wanted.
It fits when someone moves to another role or when you clean up after a test. The docker group is a good one to check, since membership there is as good as root.
The command also adds people with -a, and lets you set the full member list with -M, but for adding I’d stick with usermod -aG.
The change only affects new logins. Any session the user has open keeps the group until they log out, and processes they started earlier keep it until they end. If the removal is about trust, like an employee leaving, end their sessions as well with loginctl terminate-user alice. Also check whether the group is the user’s primary group: gpasswd -d only removes the extra membership, and the primary group is changed with usermod -g.
Further reading: gpasswd(1) manual page