Press the keep app open button in the recent apps menu. If your phone only allows you to have 1 app selected at a time, not much you can do. You could set an apps battery settings to unrestricted.
Just note trying to keep an app running all the time is going to have a noticeable battery impact