Then the Lord said to Cain, “Why are you angry? Why is your face downcast? If you do what is right, will you not be accepted? But if you do not do what is right, sin is crouching at your door; it desires to have you, but you must rule over it.”Genesis 4:6-7
Abel's offering was accepted by God and Cain's wasn't (we don't know why). Cain didn't respond by considering what was wrong with his own actions but by getting angry and eventually killing his brother.
If somebody gets something right that I get wrong, what do I do? Is my first though to look at my own failure or to tear down what the other person has done?
Sin is an opportunity for repentance or more sin. If I lie, do I repent or lash out in anger about getting caught out? Sin breeds exponentially. Repentance breaks it's power