If you don't want to be a member of a group chat anymore, you can leave the chat. You can always re-join the chat later if you change your mind.
When you leave, a note appears in the group chat's message history, letting other members know you are leaving the chat. After you leave, you can still view the group chat messages sent before.
If someone keeps adding you to group chats you don't want to be in, consider changing who can invite you to group chats or blocking that person.