This is from Genesis Chapter 4.
Adam and Eve (who were responsible for sin coming into the world (Thanks a lot guys! Grrrrrrr!) and were the first people) had two children, Cain and Abel. Cain was the older one. Cain tilled the grounds while Abel was a Shepherd. Both of them made a sacrifice for God.
Cain went and got food that he had grown from the ground. Abel got the best of his lambs and sacrificed it. God accepted Abel’s offering but not Cain’s.
It shouldn’t be assumed that Cain didn’t give his best. Indeed, likely he did. He probably spent a lot of time in sweat and toil growing the best he could. However, that was his problem. He tried to get right with God based on his own work. Abel made a sacrifice, the best sacrifice.
The truth is that the shedding of blood (Christ’s) is what saves us from our sins, not our works. Therefore, Abel acted upon this and was blessed. Cain tried to earn his own way and God rejected it. Cain was upset. God asked why he was angry. If he had done right, he would be blessed. If not, then there was sin there and that he should act to guard against that sin and get things right with God.
Sadly, Cain didn’t get things right with God. Instead, he went and murdered his brother (He went down in history as the first murderer, though perhaps the Devil held that role in a way. See John 8:44.) . When God asked Cain where Abel was, Cain replied that it wasn’t his job to keep watch of his brother. God condemned Cain for what he had done and said that the ground wouldn’t yield for him (so much for your works now pal!) and that he would be a vagabond and wander around. Abel became the first, though certainly not the last, person martyred for choosing faith over works. By faith and the blood are we saved, not of works because you can’t get blood from a turnip.