Remove app notification when app opens from launcher
From searching, an app developer can program this functionality in but I don't think there's a global setting for it. You can investigate into IFTTT type apps like Tasker or Automate - shouldn't be too difficult to set up a trigger when an app is in foreground and then clear notifications (or disable then enable it if clearing is not supported).