If you're looking to redownload an app you've already purchased, the process is relatively simple. On Macs, open the App Store and on Android devices, open the Play Store app. You can find the application icon on one of the screens or in the applications menu. To get updates to the software you purchased, you must keep your old account and create a new AppleID for purchases in a new country.
Unfortunately, if an app is no longer available on the App Store, you won't be able to reinstall it. Although you can see the app in your purchase history, the cloud symbol will be dimmed and you won't be able to restore it. During the restore process, an actual download can only be performed if the application is compatible and available for your iPhone. To make sure you're able to redownload an app, make sure you're signed in with the same Apple ID that you used to purchase and install it.
On iOS 15 and iPadOS 15, you can easily find, search and redownload apps that you've previously purchased from your Apple ID account in the App Store itself. If you've already purchased an app and can't find it in the App Store and following the steps above hasn't helped, you might not have any luck. Even if you previously created a backup via iCloud or iTunes, the backup only points to your iPhone to re-download apps from the App Store.