How to get product collection by product sku in magento 2?

You can get product data by product SKU in Magento 2 by below code snippets,

Call product collection under the template file by below code,

How to get product collection by product id in magento 2?

You can get product data by product id in Magento 2 by below code snippets,

Call inside template file by below code,