One late summer night decades ago, while vacationing in a bayside cottage in Southhampton, N.Y., I carried our son Michael, then only 3, into the dark silence out of doors. The sky shimmered with stars. Michael tilted his head back to look up, his eyes widening and his mouth dropping open in awe.

I’ll play that image in my head, in the movie theater of my memory, this Thanksgiving. So it goes with me every Thanksgiving. Call it my mental health strategy. I compile a highlights reel featuring the moments in my life I hold most dear. All families and friends follow certain traditions on this holiday. Some offer prayers. Others go around the table declaring why they’re grateful for our earthly bounty. My ritual is to curate visual recollections.

Flashing back on these memorable moments in honor of Thanksgiving serves a special purpose. If you’re feeling low, it will pick you up. If you’re asking yourself what your life has meant, it will hint at an answer. And if you’re lucky, it will remind you of a life well and richly lived.

Recent research suggests that such a practice can be good for you, a benefit to your mental health and general well-being. One study found that recalling happy memories can lower our levels of the stress hormone cortisol. Another showed that training people to recall happy memories can lower the risk of depression.

Some psychologists believe that envisioning favorite experiences from our past can inject our lives with fresh meaning and optimism. This visualization exercise, similar to lucid dreaming — the act of dreaming consciously — can enable us to cope better with our concerns about death and inspire us about our futures. Retrieving these images can, as a bonus, reinforce those memories.

Our daughter Caroline stars in my film clips, too. One hot summer afternoon, I carried her athwart my hips into the pool at our beach club in Long Beach, New York. She had to be about 4. The bright sun beamed onto her smiling face, casting her in a golden glow, as if with a halo, as droplets glimmered on her cheeks.

Certainly our granddaughter Lucia will also figure in this footage. Almost two years ago, our family went out for dinner at a rustic restaurant in the woods of a hillside town in Italy. I’d just met Lucia days earlier. I took her outside, under the canopy of the night sky, just as I once had our son. It was my first time alone with her, and it was so quiet I could hear her softly breathing. At that moment, as never before, I wanted for nothing.

“Bringing back memories that make you happy can be useful, even beautiful, especially during stressful times such as a pandemic,” says Dilip Jeste, past president of the American Psychiatric Association and author of “Wiser: The Scientific Roots of Wisdom, Compassion, and What Makes Us Good.” “Anyone can do this. You can make a movie for yourself, re-creating something that actually happened, without even being a movie producer.”

The older I get — I’m now 68 — the more such images from my personal archive I seek to preserve. My deaf mother laughing over my impromptu act of slapstick. My father driving along and suddenly stopping short and stretching his arms across the front seat to prevent me from flying into the windshield. My grandmother taking me to museums and Broadway shows and the Statue of Liberty. My grand­father treating me to seats in Yankee Stadium for the fourth game of the 1964 World Series.

And that’s just for starters. My Uncle Leonard letting me, then 18, drive his new Corvette all over Long Island. Getting my first job as a college graduate in 1976 and going outside with snow coming down and seeing a streetlight refract the flakes into a kaleidoscopic rainbow. My wife, Elvira, daughter Caroline and granddaughter all crying simultaneously in front of a hotel in Rome as I left for my return to New York City.

Only now do I detect certain patterns and recurrences — how often, for example, these images showcase sun, sky and water, the most basic elements of our existence, and also how these moments reveal my sense of wonder and discovery, of miracles witnessed.

We’ve all had a tough year. Whatever we can do to make ourselves feel better, we should do. And maybe we should show a double feature. Our highlight reel could, like the top 10 plays shown daily on ESPN, also acknowledge all the nurses and supermarket cashiers and Amazon delivery drivers who’ve kept us going through the pandemic.

Just recently, I came to know a first-time mother of a 1-year-old who goes to a hospital five days a week to do her job as a nurse in the intensive care unit. I’ve also met a porter in our apartment complex who every night at 7 for months sprinted around our central courtyard carrying aloft an American flag. Such people have also earned cameos in my private showings.

“Remembering your favorite experiences can give you a sense of some control, even during a crisis” says Jeste, also a distinguished professor of psychiatry and neurosciences at the University of California, San Diego. “You can feel closer to your loved ones. And the benefits are physical, too. Creating your own virtual reality can lower inflammation and improve your immune system.”

The cinema of your imagination has no limits. So go ahead and give yourself a treat. Show yourself everything you want to see. Recruit those memories and edit as you see fit. You’ll create the illusion, if only for a minute, of the past brought back. Best of all, you’ll be reminded of how your cup runneth over. And you’ll feel more thankful than ever.

Bob Brody, a consultant and essayist in New York, is the author of the memoir “Playing Catch With Strangers: A Family Guy (Reluctantly) Comes of Age.”