The Checkboxes field offers several options the user can check independently.

Configuration
Go to Modern Fields > Fields groups and add the Checkboxes field. Its settings are in the inspector:
| Effect | |
|---|---|
| Checkboxes layout | Vertical or Horizontal. |
| Checkboxes | The options offered, each with a label, a value, and whether it is checked by default. Each value must be unique: the settings panel flags a missing or duplicated key, and only the first option with a given value is displayed. |
Display the values
The field stores every option with its state: a list of items holding a label, a value and checked. Read it with get_field() and keep the checked ones: