Want to set yourself up for a secure retirement? Then make these 3 financial moves in your 40s.

Maurie Backman
The Motley Fool

Many people worry about having enough money to live on during retirement. And that's an understandable fear.

Living costs have been soaring lately due to inflation. While the increases we've seen have been extreme, the reality is that expenses tend to rise over time. As such, if you're in your 40s and are several decades away from retirement, it can be difficult to predict how much income you'll end up needing.

While you may have to grapple with certain unknowns when retirement is still a ways off, you can also take steps to set yourself up for long-term financial security. And if you make these moves during your 40s, you're apt to appreciate them once retirement rolls around.

► THE DAILY MONEY:  Get our latest personal finance stories in your inbox

1. Max out your IRA

Maxing out an IRA in your 40s means setting aside $500 a month, or $6,000 a year, for retirement-savings purposes. To be clear, that's not an easy thing for everyone. But if you commit to that goal, you can set yourself up with a lot of money for the future.

A good way to stay on track in that regard is to find an IRA that offers an automatic savings feature and set it up so that $500 gets transferred from your checking account every month. If you put the process on autopilot, you'll be less likely to spend that $500 impulsively and miss a month's contribution here and there.

RETIREMENT INCOME:  5 ways you can bring in extra cash

2. Invest in dividend stocks

The great thing about dividend stocks is that they offer two opportunities to make money. First, the dividends you collect can be reinvested for added growth during your 40s, and once you're retired, you can cash out those dividends and use them as income.

Additionally, companies that consistently pay dividends are often stable businesses with solid growth potential. So if you hold dividend stocks for many years, their value could grow in time.

3. Start funding an HSA

Healthcare could end up being one of your largest expenses in retirement, if not the largest. That's why saving for it in advance is important. If you qualify for an HSA, it pays to take advantage of it.

HSA eligibility hinges on being enrolled in a high-deductible health insurance plan. But the great thing about HSAs is that they're triple tax-advantaged. Contributions go in tax-free, investment gains are tax-free, and withdrawals are tax-free when used for qualified medical expenses.

Another great thing about HSAs? Once you turn 65, you can treat yours like a traditional retirement plan and withdraw funds for any purpose without incurring penalties. You'll pay taxes on non-medical withdrawals, but that's no different than the taxes you'd pay on withdrawals from a traditional IRA.

HOW DOES A RECESSION AFFECT YOU?  It could be harder to get a loan and more

Chances are, though, you'll need the bulk of your HSA funds to cover senior healthcare costs, from Medicare premiums to copays. So funding an HSA a few decades ahead of retirement could make it so you have one less expense to stress about when you're older.

If you're only halfway through your career, you may not be ready to focus on retirement just yet. But if you push yourself to make these key moves, you could really set yourself up for long-term success.

Offer from the Motley Fool

The $18,984 Social Security bonus most retirees completely overlook: If you're like most Americans, you're a few years (or more) behind on your retirement savings. But a handful of little-known "Social Security secrets" could help ensure a boost in your retirement income. For example: one easy trick could pay you as much as $18,984 more... each year! Once you learn how to maximize your Social Security benefits, we think you could retire confidently with the peace of mind we're all after. Simply click here to discover how to learn more about these strategies.

The Motley Fool has a disclosure policy.

The Motley Fool is a USA TODAY content partner offering financial news, analysis and commentary designed to help people take control of their financial lives. Its content is produced independently of USA TODAY.