Hi @Rohit_Maurya,
I recommend you build your app as a Theme App Extension, providing App Blocks. When a merchant uninstalls an any app that provides App Blocks, those blocks will automatically no longer render in the editor or on the storefront and configuration data will be automatically cleaned up when the page is next saved.
Outside of this flow, as soon as the merchant has uninstalled your app access tokens will be immediately revoked, preventing API access.