how to achieve this?kindly help me please?
Magento add URL-rewrite for product here: Magento\CatalogUrlRewrite\Observer\ProductProcessUrlRewriteSavingObserver
In your extension you should add "before" plugin for execute method. See magento tutorial
In your plugin method you should add:
$product->setUrlKey($product->getUrlKey() . '_' . $product->getId());
(Of course, also you can add some checks for exists product ID in URL key for avoid
P.S. This method will not modify URL-key attribute (because product was saved before), but will modify URL rewrite.
P.S.2. You can use around plugin and after creating URL rewrite set original URL-key for product for avoid some conflicts.