In some apps, you can enable background restriction to prevent them from using the battery while running in the background.
Note: When background restriction is enabled, the restricted apps may not work as usual and notifications may be delayed.
Home screen, swipe up and then tap
Tap an app you want to configure, and then tap
Manage battery usage, tap
Repeat the above steps to turn on background restriction in other apps.