Genesis 4:1 Now Adam knew Eve his wife, and she conceived and bore Cain, and said, "I have acquired a man from the LORD." (NKJV)
Please read the whole of Genesis chapter four before reading this any further.
Cain was the offspring of Adam and Eve. Some people think he was the product of the devil. Satan never has and never will create a human being. Cain was a child acquired from the LORD. Genesis 4:1 takes the trouble to record this fact that would normally be assumed.
The bible wants us to understand that Cain was a normal person like you and me who simply fell to anger. In fact Cain's problem started with anger.
Cain and Abel both brought offerings to the Lord. Cain's offering was rejected for reasons known to God and Cain. I think Genesis 4:7 makes this fact quite plain.
Genesis 4:7 "If you do well, will you not be accepted? And if you do not do well, sin lies at the door. And its desire [is] for you, but you should rule over it." (NKJV)
God would have not told Cain about 'doing well' if Cain had no ideal of what was right in the first place. Cain knew how to offer a sacrifice to God in the proper way. Maybe he just could not be bothered to do it.
Cain got angry as a result of his rejected offering. Anger in itself is not a sin. Holding onto anger is where the danger comes. When you understand what anger can do, you would be a fool to entertain it.
Ecclesiastes 7:9 "Do not hasten in your spirit to be angry, For anger rests in the bosom of fools." (NKJV)
Ephesians 4:26-27 "Be angry, and do not sin": do not let the sun go down on your wrath, 27 nor give place to the devil." (NKJV)
As long as you entertain anger satan (or more precisely, his demonic forces) will have a doorway into your life. If you give satan a place to stay he is sure to leave a mess. Ask brother Cain about it.
Ephesians 4:30-31 "And do not grieve the Holy Spirit of God, by whom you were sealed for the day of redemption. 31 Let all bitterness, wrath, anger, clamor, and evil speaking be put away from you, with all malice." (NKJV)
Grieving the Holy Spirit means a lack of anointing in our life. It is one of the reasons why there is a lack of the gifts of the Holy Spirit among many Christians today.
>Genesis 4:6 "And the Lord said to Cain, why are you angry? And why do you look sad and depressed and dejected?" (The Amplified Bible)
If anger is a problem you have why not treat it as a problem immediately. Just like you would a headache. Ask the Lord for help. Remember -
Ecclesiastes 7:9 "Do not hasten in your spirit to be angry, For anger rests in the bosom of fools." (NKJV)