Given what is portrayed in the media, some (incorrectly) believe that if another individual is attacking you, you have every right to use whatever means necessary to protect yourself. This is not necessarily the case. California has laws dedicated to self-defense and the kinds of actions that qualify. Specifically, self-defense is defined as the use of force such that you protect yourself from the fear of imminent peril of death or great bodily injury. Self-defense can also apply to the above when the death or injury is directed at other individuals.
In order for the defendant to use self-defense as a credible defense in a criminal trial, there must be sufficient evidence that the defendant feared imminent death or bodily injury, acted forcefully or used violence such that they could defend themselves, and used force or violence proportional to the fear of imminent death or injury. The fear of imminent danger cannot be a fear that will manifest down the line – the fear must be imminent. The possible death or great injury must happen immediately, and as such the defendant must have acted in such a way that protected their life. Furthermore, the necessary proportionality means that the defendant cannot have used excessive force. It would be unjustifiable for the defendant to kill someone who had only threatened to punch them.
Moreover, you can also be afforded self-defense as a credible defense if you acted reasonably to protect another individual from death or bodily injury. The same elements must be proven as those for self-defense for yourself. In casual conversation, people throw around the term self-defense as if it always applies, but in a criminal trial the self-defense case must be reasonable and justifiable. As such, not all actions will be accepted under the aforementioned elements.