Because God is righteous, Holy and just, our sin separates us from God and incurs a moral debt we cannot pay, and the payment is death. Unless that debt is paid for that sin remains and separation from God remains.
God is just, meaning He cannot dismiss sin without payment. God is also Holy, meaning He cannot be in fellowship with sinful beings. So the only one who can pay that debt is one who not only is sinless (has no debt) but has enough moral currency by living a perfect life.
Since mankind is fallen, the only possibility of a perfect person to pay our debt must be God in the form of a human. Since God is not only just but also love, God did exactly this by sending God the Son in the form a man to pay the debt we owe, death.
So how is his death applied to us? Either we pay the debt or Christ pays our debt for us.
The only way Christ pays our debt is if we give up ownership of our lives to Him. This is what it means to have faith in Christ, to accept Him as “Lord”. He owns us and all we own and owe. Since He owns us He takes on and pays for our debt. This also means that if he is our Lord we should live in submission to and in obedience to God.
Col 2:13-14 And you, who were dead in your trespasses and the uncircumcision of your flesh, God made alive together with him, having forgiven us all our trespasses, by canceling the record of debt that stood against us with its legal demands. This he set aside, nailing it to the cross.