When you protect yourself forcefully against an attack, that's self-defense. If you kicked a dog that tried to bite you, you don't need to feel bad: it was self-defense.
The act of defending yourself, protecting yourself from being physically harmed, is self-defense. You can take a class to learn tactics of self-defense; many martial arts can be used this way, to fend off an attacker. Self-defense is also a legal right — by law, people can use "reasonable force" to defend their own lives. Self-defense was originally a sporting term, first used in fencing and then in boxing.