God, in His great love, developed a plan whereby we could receive forgiveness for our mistakes. He made provision for certain animals to be killed as our substitutes. These animals represented the Messiah and how He would die for our sins.
The Bible records that Adam and Eve had many children. Two of their sons were Cain and Abel. Both of them understood God's plan for forgiveness. Abel brought a lamb to the altar and sacrificed it to God, and God accepted the offering. Cain brought fruit to the altar as his sacrifice instead of a lamb.
God did not accept Cain's offering. This made Cain very angry. God spoke to Cain saying, "Why are you so angry? If you do what is right you shall be accepted, but if you do not, then sin lies at your door, desiring to get you, but you must overcome it."
Cain chose not to do things God's way, but chose to do things his way. As a result, Cain killed Abel. Abel has a place reserved for him in heaven because he had already offered the blood of the animal and received God's forgiveness.
It is not good deeds or good fruits that will get us to heaven; only through the death of Messiah Yeshua can we have forgiveness. All of us have sinned and fallen short of God's plan for us. That is why it is so important for each one of us to accept the Messiah's death as the punishment for our sins and accept His righteousness to keep us from continuing to sin.