Magento 2 Get product collection

In Magento 2 the best way to get a product collection is to use the product repository. Here is an example on how to get a product collection in a block class.