Overwrite twig (template) files from a contrib module in my custom subtheme? I need to overwrite and adjust the twig (template) files from the Facet module in my custom subtheme? Is that possible? I need to change below markup and CSS classes (to debug faster, I also added my template suggestion here):

&lt;!-- THEME DEBUG --&gt;
&lt;!-- THEME HOOK: 'item_list' --&gt;
&lt;!-- BEGIN OUTPUT from 'themes/custom/my_theme/templates/dataset/item-list.html.twig' --&gt;
&lt;div class="item-list"&gt;
    &lt;ul data-drupal-facet-id="contactvoorkeur" class="js-facets-checkbox-links"&gt;
        &lt;li class="facet-item"&gt;
            &lt;input type="checkbox" class="facets-checkbox" id="contactvoorkeur-email" data-facetsredir="/search-person/cards?f[0]=contactvoorkeur%3Aemail"&gt;
            &lt;label for="contactvoorkeur-email"&gt;

                &lt;!-- THEME DEBUG --&gt;
                &lt;!-- THEME HOOK: 'facets_result_item' --&gt;
                &lt;!-- BEGIN OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' --&gt;
                E-mail &lt;span class="facet-count"&gt;(4)&lt;/span&gt;
                &lt;!-- END OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' --&gt;

            &lt;/label&gt;

            &lt;a href="/search-person/cards?f[0]=contactvoorkeur%3Aemail" rel="nofollow" data-drupal-facet-item-id="contactvoorkeur-email" style="display: none;"&gt;
                &lt;!-- THEME DEBUG --&gt;
                &lt;!-- THEME HOOK: 'facets_result_item' --&gt;
                &lt;!-- BEGIN OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' --&gt;
                E-mail &lt;span class="facet-count"&gt;(4)&lt;/span&gt;
                &lt;!-- END OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' --&gt;

            &lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="facet-item"&gt;
            &lt;input type="checkbox" class="facets-checkbox" id="contactvoorkeur-post" data-facetsredir="/search-person/cards?f[0]=contactvoorkeur%3Apost"&gt;
            &lt;label for="contactvoorkeur-post"&gt;

            &lt;!-- THEME DEBUG --&gt;
            &lt;!-- THEME HOOK: 'facets_result_item' --&gt;
            &lt;!-- BEGIN OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' --&gt;
            Post &lt;span class="facet-count"&gt;(2)&lt;/span&gt;
            &lt;!-- END OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' --&gt;

            &lt;/label&gt;

            &lt;a href="/search-person/cards?f[0]=contactvoorkeur%3Apost" rel="nofollow" data-drupal-facet-item-id="contactvoorkeur-post" style="display: none;"&gt;

                &lt;!-- THEME DEBUG --&gt;
                &lt;!-- THEME HOOK: 'facets_result_item' --&gt;
                &lt;!-- BEGIN OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' --&gt;
                Post &lt;span class="facet-count"&gt;(2)&lt;/span&gt;
                &lt;!-- END OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' --&gt;

            &lt;/a&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;


My main goal is to:

1) How do I add a bootstrap css-class list-group to the existing facet class js-facets-checkbox-links. So I get:

&lt;ul data-drupal-facet-id="contactvoorkeur" class="list-group js-facets-checkbox-links"&gt;


2) And how do I replace an existing facet class facet-item with list-group-item:

&lt;li class="list-group-item"&gt;
Since you didn't clarify any specific module, i'll explain it with Paragraphs.

In the Paragraphs folder there is a folder called "templates", this will be the default template used by all fields that use paragraphs.

If you copy these templates and paste them into your own custom theme you can edit them as much as you like, using twig debug you can specify it per field.

Don't forget to clear your cache when editing!