Genesis 4:11-15 New International Version (NIV)
11 Now you are under a curse and driven from the ground, which opened its mouth to receive your brother’s blood from your hand. 12 When you work the ground, it will no longer yield its crops for you. You will be a restless wanderer on the earth.”
13 Cain said to the Lord, “My punishment is more than I can bear. 14 Today you are driving me from the land, and I will be hidden from your presence; I will be a restless wanderer on the earth, and whoever finds me will kill me.”
15 But the Lord said to him, “Not so; anyone who kills Cain will suffer vengeance seven times over.” Then the Lord put a mark on Cain so that no one who found him would kill him.
Cain was severely punished for the murder he committed. God judges all sin, and he punishes appropriately. He does not punish out of vengeance. God desires to correct us when we sin. He knows that without correcting the sin, that would be to our detriment. It is for our good that he corrects us when we sin. God wants to restore our fellowship with him. If there is a time that you may be corrected for a sin, do not resent the correction, but renew your fellowship with God.