filtering entries by category
You don't actually need to look at the URL segments, because Craft automatically populates your template with a category variable whenever it matches the current URL to a category's URL. All you need to do, is to make sure that your category URLs point to the correct template, and to account for that template being rendered both with a category variable and without (i.e. for the default news index listing).

First, you'll need to make sure that the URL format for your category group is correct – you should probably use something like news/{slug} or perhaps news/categories/{slug}. Also, set the "Category template" to your news index template, e.g. news or whatever template path you're actually using for the news index.

Then, you can filter your entries like the following, using the relatedTo parameter:

{% set category = category ?? null %}
{% paginate craft.entries.section('news').featured('not 1').relatedTo(category).limit(6) as pageInfo, pageEntries %}

...


One gotcha to note is that whenever you pass a NULL value to the relatedTo() parameter (which will happen whenever the category variable is empty), Craft will ignore the parameter and return all entries – which works in this case, as the same template should also double as your news index.