use WorkManager:
WorkManager is responsible for (schedule deferrable tasks) that can be completed at any later time.
Use WorkManager when a task must be completed immediately and must continue to be processed even if the user puts the application in the background or the device restarts.
use Coroutines:
Coroutines are designed to (perform a task asynchronously) and immediately.
The task will end when the user goes from a certain scope or finishes an interaction.