"By faith Abel offered to God a better sacrifice than Cain" (Heb 11:4).True worship requires coming to God on His terms.
At the heart of every false religion is the notion that man can come to God by any means he chooses—by meditating, doing good deeds, and so on. But Scripture says, "There is no other name under heaven that has been given among men, by which we must be saved" (Acts 4:12). That name is Jesus Christ, and we come to Him by confessing and repenting of our sin, trusting in His atoning death on the cross, and affirming His bodily resurrection from the grave (cf. Rom. 10:9-10). There is no other way to God.
Centuries before Christ's death, God provided a means of worship and sacrifice. Genesis 4:3-5says, "It came about in the course of time that Cain brought an offering to the Lord of the fruit of the ground. And Abel, on his part also brought of the firstlings of his flock and of their fat portions. And the Lord had regard for Abel and for his offering; but for Cain and for his offering He had no regard."
Apparently God had designated a special time for sacrificing because "in the course of time" (v. 3) literally means, "at the end of days"—at the end of a certain period of time. Additionally, He initiated a particular pattern for worship and sacrifices. Otherwise Cain and Abel would have known nothing about how it was to be done.
God required a blood offering for sin. Abel came in faith, acknowledged his sin, and made the appropriate sacrifice. His offering was better than Cain's because Cain neglected the prescribed sacrifice, thereby demonstrating his unwillingness to submit to God and deal with his sin.
There was nothing intrinsically wrong with Cain's offering. Grain, fruit, or vegetable offerings were included in the Mosaic covenant. But the sin offering had to come first. Like so many today, Cain wrongly assumed he could approach God on his own terms. In doing so he became the father of all false religions, and his name became synonymous with rebellion and apostasy (cf. Jude 11).
taken from: https://www.gty.org/library/devotionals