iOS 4's new fast app switcher interface also allows you to kill both Apple and 3rd party App Store apps that may be causing problems in the background.
To access the fast app switcher in iOS 4, double click the home button on iPhone 4 iPhone 3GS, or iPod touch G3. The interface will slide up and reveal a second dock-like set of app icons "in the background". To kill an app, tap and hold the app until the icons begin to jiggle, then tap the minus symbol (-) at the top left corner. The app will then disappear, "deleted" from the background dock (but not from your iPhone or iPod).
This force quiwill do a couple of different things depending on the type of app.
First, with built-in Apple apps, if you kill them from the fast app switcher, they will still keep running in the background. For example, if you kill Mail you will still receive Mail (it doesn’t kill the background thread that checks, sounds/vibrates, and updates the badge). Instead, it will force the background thread(s) to restart. If something isn't working right with Mail -- messages aren't showing up properly -- this is a great way to clean in out and get it going again. Likewise, it can force Safari to reload pages, iPod to fix weird behavior, and otherwise quickly handle problems that might not need a full reboot.
For App Store apps, if you kill them from the fast app switcher they will no longer function in the background. You'll still get push notifications because those are handled by an external server, but you'll lose things like background music playing, navigation, VoIP, and saved state (when you next launch the app, it won't be where you left it but will relaunch from the beginning). Again, if an app is misbehaving or otherwise giving you problems, killing it can be a quick way to force a refresh without having to resort to rebooting your iPhone or iPod touch.
Remember, you don't generally have to manage background apps in iOS 4. For apps that aren't streaming music, location (turn-by-turn navigation), or VoIP (like Skype) you only ever need kill them if they're obviously not working right. When it does come to streaming music, location, and VoIP, those can effect your battery life (especially background Skype right now), so you may want to keep a closer eye on them and kill them if you won't be using them for a while.
Note: for iOS 3.x, iPhone 3G, iPod touch G2, and earlier devices, you can kill all active background tasks by holding down the sleep button until the "slide to power off" screen appears, and then holding down the home button until you're reset to the home screen.
If you ever make use of the background app kill, let us know how it works for you. For more features, see our complete iOS 4 walkthrough.