"6 And the Lord said unto Cain, Why art thou wroth? and why is thy countenance fallen?
7 If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall be his desire, and thou shalt rule over him."
The Lord was essentially saying to Cain, why are you angry? if you did what I asked, I would have accepted your sacrifice. The Lord then warned Cain that if were to not repent and he persisted in his wickedness that the adversary would gain power over him.
Instead of repenting, Cain became Jealous of his brother's Flocks and he united with the devil and slew Abel and obtained his property. Cain was then cursed and spent the rest of his life as a "a fugitive and a vagabond"
Abel died a righteous and justified man having had his sacrifice accepted of the lord. Cain died after a cursed life only to receive his just rewards. Cain's mistake, before he united with the devil and before killing his brother, was trying to remove Christ from his life to fit his circumstances and to gratify his pride.
May we all learn from this lesson and make the sacrifices in our lives necessary to keep Christ at the center of our lives.