It's never a bad idea to follow advice from Warren Buffett. The billionaire investor has a wealth of knowledge and advice out there for people willing to listen. His annual meetings and shareholder letters offer significant insight into how best to approach investing. 

There's one particular piece of his advice that today could prove immensely valuable to investors, one that could save you from incurring significant losses. If you've lost big on an investment, he says, "The most important thing to do if you find yourself in a hole is to stop digging."

What's the significance of this quote?

Investors who have incurred losses on a stock may consider themselves to be in a hole. The deeper the loss, the deeper the hole. And there can be a motivation to try and dig yourself out of this position by taking on more aggressive investments or averaging down.

For instance, suppose you bought shares of COVID-19 vaccine maker Moderna (MRNA -0.58%) last year when it was near its high of $497. If you were to buy an equal amount of shares now, at a price of around $128, that would bring your average down to $312.50. And if you were to buy twice as many shares at the current price, your average would be $251. 

There can be an incentive to load up on the stock -- it will bring your average cost down. This would be the "digging" part of the equation. But in doing so, now you have invested significantly more money into an investment that has been in a free fall. Generally, Buffett isn't opposed to buying a good stock that has fallen in value, but the problem is when it's a risky buy (like Moderna is). In that situation, you could in effect be digging a deeper hole for yourself if the stock may not have strong prospects of recovering.

Averaging down isn't always the best strategy

In the case of Moderna, the healthcare company faces a challenging road ahead. COVID-19 revenue beyond this year remains uncertain as global economies open back up and look to return to normal. While there will be some demand for booster shots and possibly even its COVID-19 vaccine that targets the omicron variant (should it obtain approval), there's still a strong likelihood that Moderna's revenue will fall in the years ahead. Although the Food and Drug Administration (FDA) granted Emergency Use Authorization (EUA) of its vaccine for children between the ages of six months and five years, fewer than one in five parents have indicated they would vaccinate their children as soon as they can.

Novavax (NVAX 2.06%) is another example of a stock that's fallen heavily. Year to date, it has crashed 72%, which makes Moderna's 50% decline look modest in comparison (the S&P 500, meanwhile, is down by 23%).

And in Novavax's case, it doesn't even have an approved COVID-19 vaccine for the U.S. market. Despite a recommendation from an FDA Advisory Committee, the FDA itself has not yet granted an EUA for Novavax's vaccine.

Averaging down in these situations can prove to be dangerous. Both stocks are falling hard -- and for good reason. The future of these companies is uncertain. Averaging down simply for the sole reason that a stock is down isn't a great idea, and it could prove costly to investors.

Discretion is the better part of valor

If a stock isn't performing well, the best option may simply be to sell your shares and look at other stocks instead. Moderna and Novavax are two examples of companies facing a tough road ahead, and there is no shortage of others. Rather than doubling down on those investments and putting more money at risk, investors may be better off buying shares of growth stocks with brighter and more certain futures.