When Cain made an offering to God with wrong motives, God rejected it. But God assured Cain that if he did the right thing, God would accept him.
Cain ignored God's warming, killed his brother, refused responsibility, never repented and thought he should get off lightly (Genesis 4).
Jude refers to those who follow the "way of Cain" - "looking" religious while inwardly rejecting the authority of God's words (Jude).
And 1 John 3:12-14 warns that people like Cain will persecute people who do the right things.
Cain's life warns us to make right choices. But it also warns us that when we make right choices some of our friends, family, and co-workers may be jealous, resentful and cruel.
We must be careful to avoid self-righteousness and depend on God's Spirit when dealing with opposition. But it's helpful to know that no matter how graciously we share, some folks won't like us (Matthew 10:22).