If you break one of the Ten Commandments, does it mean that you sinned? Of course, the consequence, I believe, is death, correct? However, if you confess what you did and repented, then God forgives you and you don't have to die, correct?
Each of the Ten Commandments in the Old Testament carried a death penalty in certain circumstances. Premeditated murder carried a death penalty, but accidental murder required living in a city of refuge until the death of the current high priest. Lying in court that could have resulted in a death penalty, carried a death penalty, but a lie that would have resulted in say the loss of a home resulted in the false witness losing his home. Most stealing would result in fines, but kidnapping carried a death penalty. Even breaking the Sabbath carried a death penalty (Exodus 31:13-17).
However, death penalties could not be carried out unless there were two or more witnesses to the crime. The witnesses had to be from two independent sources.
"Whoever kills a person, the murderer shall be put to death on the testimony of witnesses; but one witness is not sufficient testimony against a person for the death penalty" (Numbers 35:30).
"Whoever is deserving of death shall be put to death on the testimony of two or three witnesses; he shall not be put to death on the testimony of one witness" (Deuteronomy 17:6).
Confession and repentance did not necessarily remove the death penalty. A confessed murderer would still get the death penalty. Achan still died after confessing that he stole from Jericho. "Now Joshua said to Achan, "My son, I beg you, give glory to the LORD God of Israel, and make confession to Him, and tell me now what you have done; do not hide it from me." And Achan answered Joshua and said, "Indeed I have sinned against the LORD God of Israel, and this is what I have done: ... And Joshua said, "Why have you troubled us? The LORD will trouble you this day." So all Israel stoned him with stones; and they burned them with fire after they had stoned them with stones" (Joshua 7:19-20, 25).