This is a great question, and in Scripture the answer is different depending on your relationship with God.
Ancient Israel was given many laws by God, and it was clearly stated what constitutes murder and what would be an accidental death. Murder was punishable by death, while accidental death was not, but still had consequences which are detailed in Numbers 35. These laws would apply to most of the people on the earth. They were allowed to defend themselves and their families.
However, to those who have given their earthly lives to God, to follow His son even take up his cross daily (Luke 9:23) … to be willing to die for Jesus as the Apostle Paul said in Acts 21:13 … the answer is different. We are told "Love your enemies, do good to those who hate you, bless those who curse you, pray for those who mistreat you. Whoever hits you on the cheek, offer him the other also; and whoever takes away your coat, do not withhold your shirt from him either." This gives a clear direction for how we should treat those who hurt us … we are not to use any force except the love of God to defend ourselves.
But, what if they hurt our family … is this different? Don't we have a responsibility to protect others, especially our family? While this question is not specifically answered in Scripture, the principles are laid out for us. We are to love our families as our own flesh (Ephesians 5:28,29), so we can use these same principles as to how to protect ourselves to extend to our families. We love our families "just as Christ also loved the Church and gave himself up for her" (Ephesians 5:25). And yet Jesus said "He who loves son or daughter more than me is not worthy of me" (Matthew 10:37).
The bottom line is if we have truly given ourselves to the Lord, we are to trust His wisdom in our lives and our families' lives … above our own wisdom. Consecrated, followers of Christ may not use physical force to defend themselves or their families. Jesus never used force as a defense. When the soldiers came to capture Him, Peter sliced off a man’s ear. Jesus’ response was, “…Put up the sword into the sheath: the cup which the Father hath given me, shall I not drink it?” John 18:11. We need to submit to God’s will (nonviolence) in every issue of our lives.
We are to trust that the one who can control the wind and the sea (Matthew 8:27) can overrule even temporary harm to our bodies or our families for the best good in the end. He will make even the wrath of man to praise Him (Psalm 76:10). What they mean for evil, God means for good, just as when Joseph's brothers sold him into slavery and God used that to put Joseph in the place to save the people from 7 years of famine. Genesis 50:19-21 shows how Joseph took this experience, "And as for you, you meant evil against me, but God meant it for good in order to bring about this present result, to preserve many people alive."