"Thou Shalt Not Kill" Deuteronomy 5:17, KJV
So the LORD said, "I will wipe mankind, whom I have created, from the face of the earth—men and animals, and creatures that move along the ground, and birds of the air—for I am grieved that I have made them." Genesis 6:7
Now God said not to kill. Yet He sent a flood to wipe out the earth. There are numerous times that God commanded His people to destroy entire cities. This is the same God right? I mean God would not break His own commandment would He? Of course not! Don't be silly.
What is the difference between a man who goes out and shoots a person in the street for money. Then another man who is a judge and declares the shooter to die?
Motive! Do not kill is saying don't go out and kill someone just because you can or for personal gain. When God destroyed the world with the flood he did it because the world was wicked and evil. God declared that some one had done wrong. In the case of the flood all were guilty of turning from God for their own wicked ways. Everyone except for one family. God delivered what is know has justice.
If a criminal pulls a gun on a cop and the officer shoots Him ,then is the cop a killer? No He was in the right. Now in the same situation. Say that the criminal shoots and kills the cop. Is that murder? Yes it is. He killed and innocent man.
We have people who are appointed to call for justice. Judges, officers, our armed forces,etc.
God is THE JUDGE! The creator of the world says what is right and what is wrong and when someone sins there has to be consequences. There is a penalty. In some events God has declared death to many, some, or none. He judges, He does not murder. He does this because He is a just God. Not a murderer and not a liar.