On Android, iPhone, and KaiOS, you can decide who can add you to a group by adjusting your WhatsApp Settings.
Note: Changes to group privacy settings can’t be made on WhatsApp Web or Desktop, but the settings from your phone will be synced with WhatsApp Web and Desktop.
Change group privacy settings
Go to WhatsApp Settings:
Android: Tap More options > Settings > Account > Privacy > Groups.
iPhone: Tap Settings > Account > Privacy > Groups.
Everyone: Everyone, including people outside of your phone's address book contacts, can add you to groups without your approval.
My Contacts: Only contacts in your phone's address book can add you to groups without your approval. If a group admin who's not in your phone's address book tries to add you to a group, they'll get a popup that says they can't add you and will be prompted to tap Invite to Group or press Continue, followed by the send button, to send a private group invite through an individual chat. You'll have three days to accept the invite before it expires.
My Contacts Except...: Only contacts in your phone’s address book, except those you exclude, can add you to groups without your approval. After selecting My Contacts Except… you can search for or select contacts to exclude. If a group admin you exclude tries to add you to a group, they’ll get a popup that says they can’t add you and will be prompted to tap Invite to Group followed by the send button to send a private group invite through an individual chat. You'll have three days to accept the invite before it expires.