Why don't you try education and common sense?
Yes, that should do the trick.
Enraged Killer: I was going to go into that club and kill everyone whose behavior I find distasteful, but thanks be to my teachers who made me realize that violence is the wrong way to solve my problems!
My friends on the left say that the only solution is to ban all guns. My friends on the right say the only solution is to ban all immigrants. They're all looking for a one-size-fits-all easy answer to a complex problem. The thing is, society is messy. Another reply in this thread said that there aren't just good guys and bad guys; people are good sometimes and bad sometimes. That's exactly it. Banning guns won't work because (a) that genie has left the bottle and (2) criminals can always get guns, especially now that they can print them; banning immigrants won't work because (a) doing so would punish the innocent as well as the guilty, thus taking away the freedom that makes this country what it is and (2) criminals can always sneak in no matter how high we build the wall; education and common sense won't work because rage and fanaticism are toxic to common sense (see above hypothetical situation); more guns won't work because then you have a crowd of frightened, angry vigilantes firing into a random mix of killers and innocent bystanders. One of my friends mentioned a statistic today that for every attack thwarted by armed self-defense, 34 additional deaths occur because of armed self-defense.
You can't stop or even measurably reduce terrible things happening, because human beings are chaotic and irrational. The best we can do is find a balance of laws that prevent honest people from doing terrible things while they're thinking rationally, without stifling freedom so much that we are a police state. Too much regulation and even honest people will rebel against authoritarianism; too little regulation and criminals can get away with murder. The hard part is finding that balance between the two extremes.