Cain was angry when God refused his offering. God warned Cain to repent but Cain sinned further by murdering his brother, which brought a curse on him. Cain did not believe God, did not obey God, and went away from God.
Key points
Unrepented sin leads to greater sin
God gives a place to repent
Sin brings a curse
God wants.. everyone to come to repentance.. (but if you do not) repent, you will perish