With the market near all-time highs, and inflation threatening to curtail people's purchasing power, there is good reason to worry about what the market might do next. Being invested always involves risks, but the current economic and market reality we face certainly makes those risks seem magnified when compared to "normal" times.

This raises a great set of questions: Is it safer to pull your money out of the stock market now? If the risks of staying invested are really so much greater than usual, then wouldn't it make sense to sell and wait for a better valuation to get back in?

Bag of cash balanced against investments.

Image source: Getty Images

The key trade-off you face

While those questions are easy to ask, the answers aren't quite as simple. For one thing, normal stock market volatility means that you can lose money any given day that you are invested, while $1 in cash is always worth exactly a buck. That makes being invested always riskier than being in cash, at least in the short term.

On the flip side, with inflation running over 6% and cash only offering interest rates well below 1%, keeping money on the sidelines means you'll certainly lose buying power over time. With the stock market's long-run historical returns clocking in somewhere around 10% annualized, stocks can look less risky than cash over the long run when you consider the need to protect that buying power.

With that trade-off well understood, the answer on whether it's safer to pull your money out of the stock market now depends on your time frame, not on any absolute.

Good grounding in any market conditions

Even if you expect the market to keep rising, money you need to spend from your portfolio in the next five years shouldn't be invested in stocks. If you haven't been keeping to that standard, now would be a great time to consider what might be worth selling from your portfolio to get yourself there. With the market near all-time highs, chances are there's something you own that looks like it might be worth lightening up on in order to meet your overall asset allocation goals.

Remember that your bills won't wait for a better market for their due dates. It's certainly better to sell near a high than to be forced to sell near a low simply because you need the money. Yes, you may very well leave some money on the table if the market continues to rise, but you'll also be protected from missing out on more immediate needs just because the market isn't cooperating. It's a clear example of where "Cash is (still) King."

Flexibility, and more

With a five-year buffer, the market can go down and stay down for a few years, and you still won't be forced to sell your shares just to cover your near-term costs. Of course, should you have to eat into that buffer because of a prolonged market decline, you'll want to build it back as stocks recover. Still, the flexibility that comes from having that cash buffer will let you survive most typical market declines.

In addition to the flexibility, the other related big advantage to having a buffer is the ability to truly take a longer-term perspective with your investments. When you need the market to perform well to cover your bills right now, you'll quickly find that you don't have the ability to wait for the long term once a downturn disrupts your plans. With that buffer, you can afford to wait -- and to assess your investments based on their long-term prospects.

That assessment (and not what the market has done with the company's stock lately) should help you determine your buy, sell, and/or hold decisions for the businesses whose shares you own. That framework works in good markets and in bad to help you make rational decisions on what to do with your money.

The answer to your key question

That framework can also help you answer the question for yourself as to whether it's safer to pull your money out of the stock market now or not. Because it depends on the long-term prospects of the companies you own and how they are valued compared to those long-term prospects.

If you look at your stocks and can easily see their long-term cash-generating abilities as being worth more than the company's market value today, then you'll probably want to hold on. If, on the other hand, you look at them and think to yourself, "There's no way this company will ever generate enough cash to be worth this much," then it may well be time to sell.

Company by company, stock by stock, make that assessment for yourself and you'll likely arrive at a decent answer about whether it's safer to turn your shares into cash or to continue to hold. With a long-term perspective and a buffer to get you through the near-term volatility, you'll set yourself up with a good chance for success over time.

Get started now

While nobody knows when the market will crash again, it's inevitable that there will be another crash. Getting yourself prepared while the market is still strong is a much better idea than kicking yourself after the fact. Since most of the work is based on things you should be doing anyway, it's really a no-brainer. Get started now, and you'll find yourself better prepared, no matter when the market does decide to fall.