Good thing there is some hope in John 13:34-35 But if wondering where killing was OK came from. This incomplete list might be a clue.
Psalm 137:9 ESV / 45 helpful votes
Blessed shall he be who takes your little ones and dashes them against the rock!
2 Kings 2:23-24 ESV / 31 helpful votes Helpful Not Helpful
He went up from there to Bethel, and while he was going up on the way, some small boys came out of the city and jeered at him, saying, “Go up, you baldhead! Go up, you baldhead!” And he turned around, and when he saw them, he cursed them in the name of the Lord. And two she-bears came out of the woods and tore forty-two of the boys.
1 Samuel 15:2-3 ESV / 30 helpful votes
Thus says the Lord of hosts, ‘I have noted what Amalek did to Israel in opposing them on the way when they came up out of Egypt. Now go and strike Amalek and devote to destruction all that they have. Do not spare them, but kill both man and woman, child and infant, ox and sheep, camel and donkey.’”
Exodus 21:15 ESV / 26 helpful votes
“Whoever strikes his father or his mother shall be put to death.
Leviticus 20:9 ESV / 23 helpful votes
For anyone who curses his father or his mother shall surely be put to death; he has cursed his father or his mother; his blood is upon him.
Exodus 12:29-30 ESV / 20 helpful votes
At midnight the Lord struck down all the firstborn in the land of Egypt, from the firstborn of Pharaoh who sat on his throne to the firstborn of the captive who was in the dungeon, and all the firstborn of the livestock. And Pharaoh rose up in the night, he and all his servants and all the Egyptians. And there was a great cry in Egypt, for there was not a house where someone was not dead.
Leviticus 21:9 ESV / 18 helpful votes
And the daughter of any priest, if she profanes herself by whoring, profanes her father; she shall be burned with fire.
Hosea 13:16 ESV / 16 helpful votes
Samaria shall bear her guilt, because she has rebelled against her God; they shall fall by the sword; their little ones shall be dashed in pieces, and their pregnant women ripped open.
Joshua 6:20-21 ESV / 15 helpful votes
So the people shouted, and the trumpets were blown. As soon as the people heard the sound of the trumpet, the people shouted a great shout, and the wall fell down flat, so that the people went up into the city, every man straight before him, and they captured the city. Then they devoted all in the city to destruction, both men and women, young and old, oxen, sheep, and donkeys, with the edge of the sword.
Numbers 31:17-18 ESV / 15 helpful votes
Now therefore, kill every male among the little ones, and kill every woman who has known man by lying with him. But all the young girls who have not known man by lying with him keep alive for yourselves.
https://www.openbible.info/topics/killing_children