>Thou shalt not kill.
Too vague. If someone is trying to kill me or mine, those tying to kill me or mine may be killed. Not even a second thought while doing what must be done.
It’s actually more accurate to say “thou shall not murder”.
Killing in self defense, war or punishment by law is certainly permitted throughout Scripture.