How can I use categories to filter entries? It's a pretty basic question, but for some reason all of the possible solutions do not work for me. 

I tried this: https://craftcms.com/docs/relations#the-relatedTo-param
And also this (which I really expected to solve my problem): https://craftcms.com/support/entries-related-to-category

I'm pretty sure I may have overlooked something, but I can't see what.

I made this:

{% set lastSeg = craft.request.lastSegment %}
{% set meubels = craft.entries.section('meubels').relatedTo(lastSeg) %}


And use this as a test:

{% for meub in meubels %}
test&lt;br&gt;
{{ meub.title }}&lt;br&gt;
{% endfor %}


According to every answer to related questions this should work, but unfortunately it returns nothing. But lastSegment does return the required string from the URL. (At least, I'm assuming this must be a string)

I made a list of categories which all seem to route just fine, no problems there.
The relatedTo parameter requires one of the following as an argument:
- AssetFileModel
- CategoryModel
- EntryModel
- UserModel
- TagModel
- An element’s ID
- An array of element objects and/or IDs

Passing in a string from the URL will not work. If you are not on a template that is the result of a category route, you need to fetch the category first.

{% set thisCategory = craft.categories.handle(lastSeg).first() %}


You can then use thisCategory as your argument in the relatedTo parameter.

{% set meubels = craft.entries.section(‘meubels’).relatedTo(thisCategory) %}