We've all experienced the pain of a locked-up program. The beach ball spins and spins, and you begin to question the integrity of your computer along with your will to live.
There are quite a few ways to stop an application that's not doing what it's supposed to if you can't access the normal Quit command. For example, you can click on the Apple Menu and choose Force Quit (or press Option-Command-Escape), and then pick your misbehaving child from the box that appears.
Select the Force Quit or Relaunch button there, and you're good to go.
If you prefer, you can also open Applications > Utilities > Activity Monitor, select the offending program, and click on the Quit Process button.
This is useful if your locked-up program isn't shown in the dialog box pictured above. When you've gotta stop something that's running in the background, like Snapz Pro X, LogMeIn, or Dropbox, this is a good way to do it.
It's also possible to force-quit a program from the Terminal (using the kill command) or by right-clicking on its Dock icon and holding down the Option key—really, it's like Apple provided us with more ways to force-quit programs than open them!
If you're running OS X 10.5 or later, though, the absolute easiest way to do it is to remember one simple keyboard command—Option-Shift-Command-Escape, which just adds the Shift key to the familiar force-quit shortcut mentioned above. If you press and hold that combo for three seconds, you'll force-quit your active program, which is whatever name is showing in the upper-left of your screen. Your Mac won't ask you for permission or confirmation, either—it'll just do it.
You'll see this command listed if you hold down the Shift key while you've got the Apple Menu open; Force Quit will switch to Force Quit [name of active program]. Neat, huh? You can even use this to quickly relaunch the Finder if that's what has locked up on you.
Don't get all force-quit happy unless you have to, though. You should only invoke this powerful feature when you just can't get a program to respond. One consequence of using this willy-nilly is that you may lose any data you were working on in that application, which just ain't cool. So be careful, kiddos.