ANSWER: Self-defense is the act of protecting oneself or others when the threat of bodily harm exists. Interestingly, this phrase was first used in reference to fencing (1728 A.D.), then to boxing a century later (Online Etymology Dictionary on self-defense).
In the Bible, killing in self-defense is somewhat related to our modern definition of manslaughter. Generally speaking, the killing of another person without malice (intent) or premeditation (the killing was not planned) would be considered (in the U.S. and no doubt other countries) a form of manslaughter.
What is called "involuntary manslaughter" occurs when a person is killed due to an accident by another (e.g. your car brakes fail and you accidently kill someone). A charge of voluntary manslaughter (under which self-defense might fall?) happens in the "heat of passion" such as when someone fights and kills another person with a strong blow.
Many people apply the sixth commandment to the question of self-defense. The difficulty in answering this question is due in part to different translations. The KJV Bible translation of this commandment says we are not to kill (Exodus 20:13, Deuteronomy 5:17). This translation would mean that God does not approve of the use of deadly force for self-defense regardless of the circumstances.
The NKJV translation, however, as well as most modern translations, translate verse 13 of Exodus 20 as "You shall not murder." Jesus confirmed the latter translation when he said we are not to murder (Matthew 19:18).
Our natural reaction to those who initiate violence against us and wish to do us grave bodily harm is to protect ourselves and those we love. Jesus said if a homeowner knew a thief was coming to his house he would not allow his home to be broken into (Matthew 24:42 - 44).
The above example shows that God gives us the right to protect our possessions and to do what is needed to defend ourselves (even though it says nothing about killing someone). In this regard, Ecclesiastes 3 states that there IS a time to both kill and to heal (Ecclesiastes 3:1, 3).
The Jamieson, Fausset, and Brown Bible Commentary on Ecclesiastes 3 says verses 1 and 3 states WHEN this killing is permitted. Taking the life of another can take place, " . . . judicially, criminals; or in wars of self-defense; not in malice. Out of this time and order, killing is murder."
In Numbers 35 instructions are given regarding six cities where a person might take refuge if he or she has killed another person. These cities of refuge were created by God to prevent someone who killed by accident from being killed themselves before they could stand a fair trial (Numbers 35:9 - 13, 15).
The JFB Commentary confirms the purpose of Israel's cities of refuge as it relates to self-defense. It states that when a person killed someone due to a sudden provocation or out of passion (unknowingly killing someone), the cities of refuge offered full protection.
It is interesting to note that, even though the cities of refuge no longer existed, churches were considered places of refuge in the Middle Ages. Our modern version of a place of refuge is putting someone who kills in jail so that they can live to stand trial. The above principles should give you plenty to think and pray about regarding self-defense and the Bible.