The concept of self defence is instinctive; if someone attack a you it is only human to defend yourself.
Similarly if someone attacks your child or parent or partner you are going to defend them - and rightly so - with force.
But that concept does come with limits. You have to act reasonable and proportionately.
So if a drunk shoves you in a bar you can properly shove back but you are not entitled to shoot the drunk. You can respond if a classmate of your child throws a snowball at your child - but your response cannot be to take a baseball bat the the classmate.
And self defence ends once the danger is passed. So if someone attacks you with a baseball bat you are (probably) entitled to point a gun at them and maybe even shoot them but not if they are running away.
Lawful violence is to be limited to the bare minimum necessary.
Canada's criminal law tries to take the concept of self defence, and all its limits, and reduce it to three fold test.
For self defence to apply there must be three things:
A reasonable perception of force or a threat of force against a person; that means you have to perceive a threat and your perception has to be reasonable;
A defensive purpose must associated with the actions taken; which means you have to be taking steps to defend yourself or the the person you are protecting; and
The accused's actions must be reasonable in the circumstances; this means objectively reasonable - not what you think is reasonable but what is actually reasonable.
Another way to look at it is that you can defend yourself and your loved ones. That defence can extend to using lethal force. But that defence must be the least violent that will suffice to protect. Once the danger has passed you have to cease using force.