Amid volatility in the stock market, the default advice is often to do nothing.
However, as the longest bull market in history possibly wanes — with this week erasing 2018's gains — it can be helpful to turn your attention to your own timeline.
"If you have 40 years left to invest, a bear market right now is just noise and should be ignored; in fact, often celebrated," said Doug Bellfy, a certified financial planner at Synergy Financial Planning in South Glastonbury, Connecticut.
On the other hand, Bellfy said, "a stock market crash that starts the day after you retire can cause a permanent lifestyle impact if all your money is invested there."
Here's how you should react and plan for the drops ahead, by age.
20s-30s:
If you're a young investor, your rate of return typically matters less than your savings rate, said James Sweeney, a CFP and founder of Switchpoint Financial Planning in Lehi, Utah.
He provided an example: If you're 30 with $20,000 invested, whether you earn a 10 percent or a 5 annual percent return will only result in difference of around $1,000.
But, Sweeney said, "If I can save aggressively, and put an extra $5,000 toward retirement, that has a much bigger effect on my portfolio value."
People in their 20s and 30s who are investing for retirement really are best off doing nothing as the market rages, said Alex Doll, a CFP and president of Anfield Wealth Management in Cleveland. When you put money into your 401(k) during a downturn, you're actually taking advantage of a lower-cost environment.
However, you don't want the money you need for near-term expenses in the stock market, because it has a greater chance of losing value, said Nicholas Scheibner, a CFP at Baron Financial Group in Fairlawn, New Jersey.
Keep the savings for, say, a home purchase within the year, in cash or CDs.
40s-50s:
The biggest mistake middle-aged investors can make is to sell at the bottom of a bear market, Sweeney said. "Most people still have 10 or more years until they retire, which is typically more than enough time to ride out a bear market," he said.
A bear market is said to have begun when a major index such as the S&P 500 drops more than 20 percent.
WATCH: Don't panic when stocks are getting slammed
Play Video Why you shouldn't panic when stocks are getting slammed
The 2008 downturn, when the S&P 500 plunged 56 percent, took investment portfolios between one and three years to recover (for asset allocations ranging from half stocks and half bonds, to 100 percent stocks), according to Vanguard.
Do make sure you have enough cash reserves built up to cover your upcoming expenses, including school tuition and planned vacations, said Milo Benningfield, a CFP and founding principal of Benningfield Financial Advisors in San Francisco.
"If not, consider raising cash from your portfolio now, rather than later after markets have fallen," he said.
60s-70s:
As the stock market swings up and down, older investors should avoid complacency and tweak their portfolio to make sure they're ready to exit the workforce, Synergy's Bellfy said.
"I find that investors that are getting close to retirement do sometimes need to be coaxed to reduce risk and build cash reserves," he said.
How much should you have in cash? At least two years' worth of living expenses, Bellfy said. "But more can be better if one has the ability to save up more," he said.
That way if the bear market hits just before you retire, you won't need to dig into your portfolio at reduced prices.
"Avoid the temptation to cash out your investments completely," Benningfield said. "You may have another two to four decades of spending to cover."
If you're already in retirement:
Investors who no longer receive a paycheck want to make sure they have enough of their money in cash and bonds to last them until the market heals, said Sweeney at Switchpoint. They'll also generally have Social Security and/or a pension to rely on.
He recommends building up between five and 10 years' worth of these reserves. So if you estimate that you'll need to withdraw $25,000 a year from your portfolio, you'd want to keep $125,000 to $250,000 in cash and bonds.
He said retired investors still need some growth assets such as stocks, particularly since people are living longer.
"In a bear market, pull from your bond portfolio to fund your lifestyle," he said. "Leave your stocks alone."
More from Fixed Income Strategies:
Why retirees' tax rates may be higher than they expect
If you're married and near retirement, consider this tax-saving strategy
What you need to do now before this tax strategy disappears