Fetch products from specific brand or category

Hi,
So i'm pretty new to the rain template system. I have this snippet on the homepage which fetches products added to featured products (in the ecom dashboard). But i'd like to know how to fetch products from a specific brand or category and than also change it to newest or most popular products from that specific brand or category ID:
{% for product in featured | limit(3) %}
How to change above snippet targeting a specific brand ID or category ID? Thanks in advance!