As we age, our mind and body start to fail us. The signs of decline become harder to ignore.

That’s one reason depression takes a toll on many seniors. But growing more miserable with each passing year is not a fait accompli.

Depending on what research catches your eye, you may conclude that feelings of anxiety and hopelessness increase for elderly folks—or that we get happier as we get older.

Which is it? Are we destined to crumble and turn cranky in our 80s and 90s? Or will those decades prove the richest and most rewarding of our lives?

We’re more likely to grow happier, believe it or not. Alison Gopnik, a psychology professor at University of California, Berkeley, reviewed research across many cultures and countries and found aging isn’t all doom and gloom.

“In several studies, when people were randomly ‘pinged’ during the day and asked to report their emotions, older people were more likely to report positive feelings,” she wrote in The Wall Street Journal. 

Of course, our attitude plays a big role in whether our happiness sustains us—or deserts us—in our golden years.

“We have choices about how we respond,” said Ilene Berns-Zare, PsyD, a Chicago-area executive and life coach. “Recent research shows that optimism changes the way we interpret stressful situations. So there’s always a choice.”

If you’re beset with anticipatory dread over the prospect of aging, you’re already in trouble. You will look for evidence to reinforce your pessimism. And when you find it (“More wrinkles!”), your mood will sour.

Instead, give yourself the gift of uplift. Spend time with friends or hobbyists who share your passion. Engage in pleasant distractions like community gatherings—from attending rallies in support of a cherished cause to guest speakers at the library—that divert your focus away from idle worries about getting older.

“Maybe you’re filled with mixed emotions [about aging],” Berns-Zare said. “Yes, there are highs and lows. So ask yourself, ‘How do I want to focus my attention in this moment?’”

People who practice gratitude tend to age without rancor. They don’t take fleeting pleasures for granted.

Identify three things that you’re grateful for each day, Berns-Zare says. From a budding flower to a warm bagel, consciously acknowledge what’s good and celebrate it, if briefly.

You’re also more apt to feel happy if you find meaning in everyday tasks, from checking on an ailing neighbor to clipping an article and sending it to a friend.

“As people get older, meaning and purpose are so important in building well-being,” Berns-Zare said.

Part of the challenge for seniors is that the longer they live, the more funerals they attend. They’re left coping with the loss of loved ones—and that flattens the happiness curve.

“Loneliness is associated with depression,” said Deborah Heiser, Ph.D., an applied developmental psychologist in Long Island, N.Y. “Having more intimate relationships and meaningful connections in our lives” prevents the ill effects from social isolation.

Like Berns-Zare, Heiser emphasizes the importance of making a choice to treat aging as a new chapter of life, not a soul-crushing prelude to death. 

As an aging specialist, Heiser says older folks often ask her, “What do I have to look forward to?”

“We get to choose the footprint we make in the world,” she replies.

You can assume the worst and wait for it to unfold, stewing in anxiety as the days crawl by. Or you can embrace what Heiser calls “generative behaviors” to leave your mark on the next generation. Examples include volunteering, philanthropic giving and mentoring others.

Even if you’re experiencing physical decline—a downhill spiral of illness and injury—the decision to leave a positive legacy can in itself energize you.

Making the world a better place doesn’t require sweeping gestures or heroic sacrifice. You’ll feel happier simply by passing along your accumulated knowledge or modeling empathy and kindness.

Collect your favorite recipes in a booklet that you give away. Help teachers at a local school. Pounce on opportunities to write cards to commemorate milestones in others’ lives (graduations, job promotions, anniversaries, etc.).

“It’s all part of making your life more meaningful and purposeful,” Heiser said.