One minute, all economic indicators are sitting pretty and the Dow Jones industrial average is hitting record highs. The next — blammo — we’re in the throes of a stock market “sell-off,” or “right-sizing,” or whatever you want to call it. (Semantics is probably the last thing on anyone’s mind when you’re watching chunks of your 401(k) and IRA evaporate.)

Just as it did recently, the stock market is going to decline again. But no one has the luxury of getting a calendar notice announcing the time and magnitude of a seismic stock market event. Still, just knowing that these things happen means you can create in advance a game plan for what to do while you’re in the thick of it.

To prevent a knee-jerk reaction during periods of stock market volatility, follow these five tips.

1. Trust in diversification

When a market decline hits, your results may vary — and perhaps for the better — if you’ve invested money across different baskets of asset classes.

If you’ve gone with a “set it and forget it” strategy — like investing in a target-date retirement fund, as many 401(k) plans allow you to do, or using a robo-adviser — diversification already is built in. In this case, it’s best to sit tight and trust that your portfolio is ready to ride out the storm. You’ll still experience some painful short-term jolts, but this will help you avoid losses from which your portfolio can’t recover.

If you’re a do-it-yourself type who picks mutual funds and/or stocks on your own and have spread your assets across different baskets, review your asset allocation once the market settles down and rethink how much money is in which basket, since it’s likely been thrown out of whack.

Think you’re not sufficiently diversified? Discovering this while a crash is underway isn’t ideal, but don’t move money around in a panic. There’s more below on how to decide what to buy more of (on sale!) and how best to judge whether it’s time to cull certain investments from your portfolio.

More: Getting a tax refund? 4 good ways to put it to work

More: 4 creative ways to feed your retirement savings

2. Remember your appetite for risk

Even though the stock market has its roller-coaster moments, the downturns are ultimately overshadowed by longer periods of sustained growth. That’s the reality on paper. If only our brains accepted that and didn’t trigger emotion-driven reactions — like selling during market dips and possibly missing the eventual uptick.

Investing in the stock market is inherently risky, but what makes for winning long-term returns is the ability to ride out the unpleasantness and remain invested for the eventual recovery (which, historically speaking, is always on the horizon). You’ll be able to do that if you know how much volatility you’re willing to stomach in exchange for higher potential returns.

Ideally, at the start of your investment journey, you did risk profiling. A good risk assessment questionnaire can help determine the proper asset allocation for you. If you skipped this step and are only now wondering how aligned your investments are with your temperament, that’s OK. Measuring your actual reactions during market agita will provide valuable data for the future. Just keep in mind that your answers may be biased based on the market’s most recent activity.

3. Know what you own — and why

Part of doing stock research is crafting a written record of the strengths, weaknesses and purpose of every investment in your portfolio. You should also include a list of the triggers that would make you sell a given investment. (An emotional reaction to a temporary slump shouldn’t be one of them.)

During a market downturn, this document can prevent you from tossing a perfectly good long-term investment from your portfolio just because it had a bad day. It’s like an investing roadmap — a tangible reminder of the things that make a stock worth holding. On the flip side, it also provides clearheaded reasons to part ways with a stock.

Stocks you're more likely to trade might be better fits for your IRA.
Getty Images

4. Be ready to buy the dip

Market dips are when fortunes can be made. The trick is to be ready for the fall and willing to commit some cash to snap up investments whose prices are dropping. You probably won’t catch the stock at its low, but that’s fine. The point is to be opportunistic on investments you think have good long-term potential.

If you don’t have a bottomless stack of money to buy all of the shares of all companies you want, keep a running wish list of individual stocks you would like to own. Set aside some cash so you’re ready for a flash sale when disaster strikes.

Don’t be surprised if you freeze in place during the moment of opportunity. One strategy to overcome the fear of bad timing is to dollar-cost average your way into the investment. Dollar-cost averaging smooths out your purchase price over time and puts your money to work when other investors are huddled on the sidelines — or headed for the exits.

5. Get a second opinion

It’s rewarding to be a DIY investor, especially during the good times when the stock market’s on a tear and your portfolio is going up in value. But when times get tough, self-doubt and ill-advised tactics can take root.

Hiring a fee-only financial adviser to kick the tires on your portfolio and provide an independent perspective on your financial plan can benefit even the most confident saver-investor. In fact, it’s not uncommon for financial planners to have their own financial planner on their personal payroll for the same reason. An added bonus is knowing there’s someone to call to talk you through the tough times.

More from NerdWallet:

Dayana Yochim is a writer at NerdWallet. Email: dyochim@nerdwallet.com. Twitter: @DayanaYochim.

The article Will the Stock Market Crash? Yes. Here’s What to Do Now originally appeared on NerdWallet. NerdWallet is a USA TODAY content partner offering personal finance news and commentary. Its content is produced independently of USA TODAY.