They spoke against God and Moses. Their consequence was death. Those still living confessed, “We have sinned; we spoke against the Lord and against you. Pray for us.” So Moses prayed and God told him how to help (from Numbers 21:5-9).
And as Moses lifted up the serpent in the wilderness, so must the Son of Man be lifted up, that whoever believes in him may have eternal life (John 3:14-15).
Sin, consequence and confession are part of every salvation story.