Think the stock market is just for young people? Think again. You might have stopped working, but that doesn't mean you should shun stocks.

Experts generally recommend that investors dial down their exposure to stocks leading up to and during retirement. Unfortunately, some people go too far.

You can and should invest some of your savings in stocks after retirement to reap higher returns. Here's how:

Maintaining a well-diversified portfolio minimizes risk for investors of any age — even retirees. And that includes stock holdings, especially in the current market.

One easy way to diversify is by investing in exchange-traded funds or mutual funds. These are composed of many different securities, so they are inherently diversified, and allow you to broaden your portfolio's exposure without buying all the components individually.

It's important to remember that fees and performance vary among funds. And many investment scams target retirees. Steer clear of investments — stock-based or otherwise — promising returns that seem too good to be true.

Many retirees invest in companies that tend to pay a higher-than-average portion of their profits back to shareholders, also called a dividend.

Some ETFs and mutual funds cater to dividend strategies, but this is also an opportunity to have some fun with investing. Research stocks with high — or growing — dividend yields that meet some of your other criteria for investment.

It's all well and good to understand the best practices for investing in stocks, but it's another thing to actually weather the market's twists — especially in retirement.

Americans 65 and older were less likely than all other age groups to believe that the stock market would rise each year between 2002 and 2014, according to a recent study by United Income Inc., a registered investment adviser that serves retirees. Most major stock indexes increased in all but two of those years.

Past market sell-offs might have dealt your investments a devastating blow — and future ones could again — but the long-term benefit of investing in stocks is well-documented. And having money in the stock market can often help a nest egg last longer. A 2016 study from the American Association of Individual Investors found that a higher allocation to stocks (65 percent) leads to higher returns than a lower allocation (25 percent) when money is being periodically withdrawn over a 35-year retirement period.

Anna-Louise Jackson is a staff writer at NerdWallet, a personal finance website.