How can I prevent apps from running in the background?
tl;dr
It's ok if the app in background is just an activity. Activities just consume some memory are usually  not able to run computations in the background. Therefore no CPU or battery is used for them. But if the app in background is running a service:
Ping the developer
Ping the developer! One of the greatest daemons that come with Android are Services that run in background for no reason or when a simply interval check with Android's AlarmManager would be sufficient. We need to kill them all with fire and not by ignoring them. Everything that does not involve a fix by the developer is just a dirty hack that by experience will result in other negative side-effects.
Activities that run in Background
Pure Android apps and their activities usually stay around in memory for a while after they were put out of view. But at some point they may get deleted by Android's ActivityManager if there is an ongoing memory pressure. This is intended behavior, we (the users) want it that way and it works good in recent Android versions. Therefore there is nothing wrong if you see your file manager hanging around in memory.
Services that run in background
But, if it's a service that you see running forever without apparent reason (and without the possibility to disable the service somewhere in the Apps settings), you should contact the developer. In 99% of all cases, there is no reason to waste your precious memory by doing so. Android provides with intents and the already mentioned AlarmManager enough facilities to avoid long running services. Sometimes developers will response with &quot;but Google Maps does that too&quot;. I argue that this is never an excuse to point at others, plus it doesn't provide a valid reason to run a background service.