There's always an opportunity to do something for someone else, and to reflect on your skillfulness and goodness. The Buddhist term for "positive things and happy memories" is merit[0]. The story of Angulimala is a good example[1]. He had killed around a hundred people, and the world was out looking for vengeance on him. Having repudiated violence and ordained as a Buddhist monk, he gave comfort to a pregnant woman:
"Sister, since I was born in the noble birth, I do not recall intentionally
killing a living being. Through this may there be wellbeing for you,
wellbeing for your fetus." And there was wellbeing for the woman, wellbeing
for her fetus.
It is not a coincidence that immediately after this the sutta recounts his enlightenment. That was all the merit he needed:
Then Ven. Angulimala, dwelling alone, secluded, heedful, ardent, & resolute,
in no long time reached & remained in the supreme goal of the holy life for
which clansmen rightly go forth from home into homelessness, knowing &
realizing it for himself in the here & now. He knew: "Birth is ended, the
holy life fulfilled, the task done. There is nothing further for the sake of
this world." And thus Ven. Angulimala became another one of the arahants.
Shortly after that, his past caught up with him and he was stoned, but his training kicked in:
Ven. Angulimala — his head broken open and dripping with blood, his bowl
broken, and his outer robe ripped to shreds — went to the Blessed One. The
Blessed One saw him coming from afar and on seeing him said to him: "Bear
with it, brahman! Bear with it! The fruit of the kamma that would have
burned you in hell for many years, many hundreds of years, many thousands of
years, you are now experiencing in the here-&-now!"
Then Ven. Angulimala, having gone alone into seclusion, experienced the
bliss of release.
As the footnote to this says, this is an example of having made so much merit that it swamps any suffering which might arise[2].
[0] http://www.dhammatalks.org/ebook_index.html#Merit
[1] http://www.accesstoinsight.org/tipitaka/mn/mn.086.than.html
[2] http://www.accesstoinsight.org/tipitaka/an/an03/an03.099.tha...