Well, this one is not so hard after all. Actually, it is not likely that you will need it but just in case you do... You have many ways to do it. You can do it by finding the PID of the program that has gone south, and use the kill command to terminate it, or you can use the xkill tool or other graphical tools like the ones that show the process tree.
The first thing to do to terminate a misbehaving program is to find its PID, or process ID. To do so, execute the following from a console: ps aux | grep mozilla, supposing that Mozilla is the misbehaving program. You will get something like the following:
peter 3505 7.7 23.1 24816 15076 pts/2 Z 21:29 0:02 /usr/lib/mozilla |
This tells us, among other things, that Mozilla was started by user peter and its PID is 3505.
Now that we have the PID of the misbehaving program, we can execute the kill command to terminate it. So we execute the following: kill -9 3505, and that's it! Mozilla will get killed. Note that this is only to be used when the program doesn't respond to your input anymore. Don't use it as a standard means to exit from applications.
Actually, what we have done was send the KILL signal to the process number 3505. The kill command accepts other signals besides KILL, so you can have greater control over your processes. For more info, see kill(1).