Cain was jealous of Abel, so he killed him and God allowed him to live with what he had done for the rest of his life.
He had the memory of it in his mind and I am sure Cain realized that what he had done did not make him any more happier.
We live with our mess when we dont obey God's commandments.
We realize that we are in a mess and that we are not happy when we disobey.... Yes, we may think it is the solution at the time to disobey God, but it only makes matters worse and we pay for it everyday of our lives.