At Savatthi. As he was sitting to one side, King Pasenadi Kosala said to the Blessed One: "Just now, lord, while I was alone in seclusion, this train of thought arose in my awareness: 'Who are dear to themselves, and who are not dear to themselves?' Then it occurred to me: 'Those who engage in bodily misconduct, verbal misconduct, & mental misconduct are not dear to themselves. Even though they may say, "We are dear to ourselves," still they aren't dear to themselves. Why is that? Of their own accord, they act toward themselves as an enemy would act toward an enemy; thus they aren't dear to themselves. But those who engage in good bodily conduct, good verbal conduct, & good mental conduct are dear to themselves. Even though they may say, "We aren't dear to ourselves," still they are dear to themselves. Why is that? Of their own accord, they act toward themselves as a dear one would act toward a dear one; thus they are dear to themselves.'"
"That's the way it is, great king! That's the way it is! Those who engage in bodily misconduct, verbal misconduct, & mental misconduct are not dear to themselves. Even though they may say, 'We are dear to ourselves,' still they aren't dear to themselves. Why is that? Of their own accord, they act toward themselves as an enemy would act toward an enemy; thus they aren't dear to themselves. But those who engage in good bodily conduct, good verbal conduct, & good mental conduct are dear to themselves. Even though they may say, 'We aren't dear to ourselves,' still they are dear to themselves. Why is that? Of their own accord, they act toward themselves as a dear one would act toward a dear one; thus they are dear to themselves."
That is what the Blessed One said. Having said that, the One Well-Gone, the Teacher, said further:
If you hold yourself dear then don't fetter yourself with evil, for happiness isn't easily gained by one who commits a wrong-doing. When seized by the End-maker as you abandon the human state, what's truly your own? What do you take along when you go? What follows behind you like a shadow that never leaves? Both the merit & evil that you as a mortal perform here: that's what's truly your own, what you take along when you go; that's what follows behind you like a shadow that never leaves. So do what is admirable, as an accumulation for the future life. Deeds of merit are the support for beings when they arise in the other world.