Why did God in the Old Testament order people to kill (example in 1 Samuel 15:3) or even kill the bad people that are between the Israelites? However, at the same time, the commandment says, "Do not kill"? Also in the New Testament, it says to love your enemy. Please clarify.
God allowed self-defense and civil protection. There was extreme vile behavior in these lands and amongst such people that destroying them was actually for the protection of society and control over the spread of utter corruption. Love was always a command from God, in the New and Old Testament. These cases show God's justification for His nation to establish the moral and judicial conscience of the land. Actually, many of today's laws in society are based on the Ten Commandments. Our Lord Jesus Christ emphasized love and grace without extinguishing the law and civility in society.
"Then he said, 'Let not the Lord be angry, and I will speak but once more: Suppose ten should be found there?' And He said, 'I will not destroy it for the sake of ten'” (Genesis 18:32).
"You shall not worship the Lord your God in that way; for every abomination to the Lord which He hates they have done to their gods; for they burn even their sons and daughters in the fire to their gods" (Deuteronomy 12:31).
"For the land is defiled; therefore I visit the punishment of its iniquity upon it, and the land vomits out its inhabitants" (Leviticus 18:25).
"The men of Babylon made Succoth Benoth, the men of Cuth made Nergal, the men of Hamath made Ashima, and the Avites made Nibhaz and Tartak; and the Sepharvites burned their children in fire to Adrammelech and Anammelech, the gods of Sepharvaim" (2 Kings 17:30-31).