How to load entries with a certain category only? I am trying to load entries from a section which have a category field with multiple values. Based on that, I want to show specific entries filtered by category.

Example: I have a news section and I want to load sports and entertainment news only.

Help me on this, please.
You could use this, note: this is untested maybe you have to remove the first() or use targetElement: category1.id

{% set category1 = craft.categories.id(yourId).one() %}
{% set category2 = craft.categories.id(yourId2).one() %}
{% set news = craft.entries.all({
    section: 'news',
    relatedTo: [
        'and',
        { targetElement: category1.id },
        { targetElement: category2.id }
    ]
}) %}


You should read about that topic here click