How to get product URL by specific store view in Magento 2?

Magento supports multi-website feature and each website support multi-store view to display store-based eCommerce site to visitors.

If a website has multiple store views and wants to set different URLs for the product by store view level,
you can do it in Magento by just setting the URL based on the store view.

You can get the store view product URL by using given code snippets,

When you check the Product Repository Interface with getById() method,

public function getById($sku, $editMode = false, $storeId = null, $forceReload = false);

you will see the third argument will be the store Id.
store Id indicates the store view/website id to get a store-specific URL.