When God said, “You shall not murder” in Exodus 20:13, He meant no one could take the life of another.
https://www.biblestudytools.com/bible-study/topical-studies/does-thou-shalt-not-kill-only-apply-to-murder.html#:~:text=When%20God%20said%2C%20%E2%80%9CYou%20shall,feelings%20for%20a%20neighbor%20either.?