Receive the latest business updates in your inbox

If you have (see our accompanying poll), fighting the temptation to panic is probably the most difficult task. But it may also be the most important.

As the stock market goes through a frightening selloff, investors have been wrestling with the temptation to bail out of their retirement accounts. But personal investment gurus say that's exactly the wrong reaction and could cost you many thousands of dollars in lost returns down the road.

"If you're 10 years away from retirement, staying the course is obviously the best move," says Nadav Baum, managing director of investments for BPU Investment Management in Pittsburgh. "You don't want to be penny-wise and pound-foolish because you think the market's going to drop a little more. Over time you're going to give up major returns over the next 10 years if you're thinking about getting out."

Determining risk tolerance is one of the key factors retirement account holders should do as the market gyrates. And experts point out that 401ks remain one the best ways to save for retirement because of their tax advantages and employer matching funds.

Younger investors should continue to be aggressive, the pros say, though the same strategy doesn't hold for those getting closer to retirement age.

"The only thing the current market does is it makes you evaluate your risk profile," Baum says. "Watching the stock market drop as precipitously as it has changes conventional wisdom and actually puts you into a more conservative state. That's human nature and that's OK."

Still, if you're getting close to retirement, it may make sense to consider getting out.

"For the person that has five years or less, that's not a bad move because you've also got to sleep at night," Baum says. "If it's keeping you up at night and it's driving you crazy, your health is more important than your wealth."

Questions to Ask Yourself

Investment counselors say you need to think about a few key things in this market.

Baum reduces them to three points: When you want to retire; whether the risk in your 401k portfolio reflects the risks you're willing to take, and whether the 401k will be your sole source of income.

"When you start to put those together I think then you can make a much more educated asset allocation based on age, based on barometer for risk, and if this is money I'm going to be using to retire," he says. "I think every adviser should be talking to their clients and clients should be talking to their advisers about this."

Those who aren't asking the right questions are more prone to make the wrong decisions.

Many who have seen their 401k plans drop 25 percent or more over the past year—the popular joke is that the plans have been reduced to "201k's"—are thinking about stopping to contribute or, worse yet, pulling money out of their accounts.

"We're all concerned about retirement. The key is to be patient," says Amber Dakar, personal investment specialist at Money and Markets, an online investment newsletter. "We do face unprecedented turbulent times, but don't exit the markets entirely, especially if you're 10, 20, 30 years down the road from your retirement horizon."

That doesn't mean that anyone, regardless of how far off retirement is, should take unnecessary risks.

For Dakar, putting money into safer cash-based funds is a reasonable move to take for those closer to retirement or who think higher returns are less of a priority. A fund based on US Treasuries is one way to implement that strategy.

"You're going to forego a higher yield, but this is about preservation and not a return of any kind," she says. "We're looking for safety amid turbulent market times."

To be sure, though, there are safe places to go in equity-based funds, and Dakar advocates as much as a 50 percent investment in stocks so long as investors have at least some appetite for risk. CNBC's Carmen Wong Ulrich offers advice on dollar dilemmas in video at left.

Large-cap stocks with low volatility are the preference at this point, she says. Beyond that, 401k participants need to be looking at their plans closely so they know what they're investing in.

Web sites for many plans offer questionnaires that gauge proper portfolio balances based on age and risk tolerance.

Interestingly, Baum says he has been seeing over the past two weeks investors with a bit less pessimism and bit more inclination towards getting back into stocks.

"I'm starting to see a little sentiment change with clients ... All of the sudden the conversations are starting to turn to what we should be positioning ourselves in going forward," he says. "There are truly monumental opportunities that you just don't see, that come around once in a generation, and they're here."