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,