Ok, fine - I'll get into it.
The King James translation of the Bible sucks. It translates "Lo tirtzach" into "Thou shalt not kill." Lo = No/Don't/Thou shalt not. Tirtzach = Murder. Not "kill".
Now that's not to say that we should go around killing in a non-murderous way (not even sure what that would look like TBH). However, it does help explain why the Bible might appear to record God commanding "Don't do XYZ" and then leading His people on an "XYZ spree" a few books later.
Part B, God's all about holiness. Contrary to popular English usage of that term, it does
not specifically mean "pure" or "without sin/badness/evil". The original Hebrew word is קדוש - Kadosh. The proper translation of this word is "dedicated", as in, "something dedicated (or put aside, devoted) for God's use". The term for the Temple in Hebrew is בית מקדש - Beit Mikdash - "House of Dedication". God called the Jewish people to be "holy", and went on to clarify what that meant many times throughout the Bible. It meant set apart, separated for a purpose. "In the world, but not
of the world", "Do not do as the nations around you...", etc.
This state of holiness - being set apart and differentiated from all other nations - is one of God's concerns in the Bible. It guides the kashrut laws (kosher foods vs unkosher ones), the instructions against adopting the idol worship of the Israelite neighbors, etc. It guides the harshness of certain of the punishments to be meted out to violators of God's laws - as the paraphrased verse says, a little yeast causes the entire dough to rise. A little sin in the camp left unchecked can affect the entire nation.
So, when God led the Israelites out of Egypt and into the land of Canaan, He directed them to slaughter a number of the indigenous people there, both in the interest of maintaining that differentiation, that holiness, as well as it being a punishment on those people's great sins (see
Molech - the parents burning their kids alive). God had a purpose with the Hebrew people, that of bringing forth His Son Jesus into the world and through Jesus' sacrifice on the cross for our sins, being able to tear down the veil of separation between a holy God and sinful man - our sins would no longer prevent us from fellowshipping with our Creator.
One more thing. I realize and recognize that the Bible was written thousands of years ago, and that there are no lack of passages that are relevant for the culture back then, and not so much for today. There's no hard-and-fast rule about what parts are and are not relevant, but just be aware that there
is that to take into account. For example, any verses dealing with multiple wives, or the taking of slaves from conquered nations, etc. It's safe to say that most of us don't
have multiple wives or slaves.