Imagine you are playing with your favorite toy and accidentally break it. But instead of feeling bad about what happened, you decide to ask your mom or dad to buy you a new toy so you can forget about the broken one.
Now, imagine that instead of a toy, something really important was broken, like a vase that belonged to your grandma. If you broke that vase, it would be really hard to replace it and make things ok again.
This is kind of what happened when humans sinned - we broke our relationship with God. It wasn't something that we could just say sorry for and forget about, because it had real consequences. We owed God something that we couldn't give back, and that was our perfect obedience to him.
But Jesus, who was also God, came and paid the price for our disobedience by dying on the cross. It was like he was buying back the vase that we had broken. Because of this, we can be forgiven and can have a restored relationship with God.
This is sometimes called the "ransom view" of atonement, because Jesus paid with his life to redeem us from sin and restore us to God. It's like how someone might pay a ransom to free a hostage - except instead of a person, Jesus paid the price to free us from the punishment of sin.