Cain was a farmer. One day he brought some of the fruits of his soil as an offering to the Lord. But the Lord did not look with favour on Cain and his offering but on his brother Abel instead. Because of this, Cain got very angry with his brother. Obiously God was not pleased with Cain's anger for He told him "If you do not do what is right, sin is crouching at your door; it desires to have you, but you must master it."
Cain then took his brother Abel out to the field. There he attacked Abel and killed him. When God asked Cain about Abel, Cain tried to look innocent but God found out about the killing and put Cain under a curse. Cain was to be a restless wanderer on the earth, because the ground would no longer yield any crops for him. So Cain moved to the land of Nod, east of Eden.
He built a city which he named after his son Enoch.