The viewmodel is linked to some lifecycle and will be alive accordingly.
If you're using a single viewmodel for the whole app, it should know which screen is being shown (since it should be the single source of truth for the UI state).
Since it knows, it can tell your repository to stop fetching data.