The investment community has long looked to Warren Buffett for guidance and clues about what may happen next in the market, and for good reason. The billionaire investor has proven his expertise, driving market-beating gains for Berkshire Hathaway over time. With Buffett at the helm, Berkshire Hathaway has delivered a compounded annual gain of nearly 20% over the past 58 years. That's compared with a compounded increase of a little more than 10% for the S&P 500. Buffett has done this through careful stock picking, knowledge of when to be "greedy" and when to be "fearful" in the market, and commitment to holding onto investments for the long term. All of this has earned him the well-deserved nickname of "the Oracle of Omaha."

And if we believe in Buffett's ability to predict what's next for the market, we should take a close look at his recent moves. They just so happen to represent a warning to Wall Street -- and this warning has reached deafening levels. Let's check out the details and consider what you should do before 2025.

Warren Buffett is seen at an event.

Image source: The Motley Fool.

Buffett's record cash level

First, let's consider the moves Buffett has made that stand out. He's been a net seller of stocks for several quarters. In the third quarter of this year, he built up a record cash level of more than $300 billion, representing 28% of Berkshire Hathaway's asset value; that's the highest percent in more than 30 years. And this year Buffett significantly cut his position in two of his favorite stocks: Apple and Bank of America, with more than a 20% decrease in each in the recent quarter alone.

These stock sales don't necessarily represent a lack of faith in the underlying companies, though. Buffett himself even suggested, at Berkshire Hathaway's annual meeting back in May, that he's been locking in profits on his top positions under the current capital gains tax rate -- with the idea that this rate may rise. And Apple and Bank of America remain his No. 1 and No. 3 holdings, respectively. It's also important to note that Buffett believes in long-term investing and isn't one to buy and sell according to market cycles.

Still, Buffett's moves to decrease some positions and increase cash levels, and his comments in his latest shareholder letter about "casino-like behavior" in the market, may be seen as a warning to Wall Street as indexes and valuations soar. The S&P 500 is heading for a 26% gain this year and the S&P 500 Shiller CAPE ratio, a valuation measure, is trading at its third-highest level since the S&P launched as a 500-stock index in the late 1950s.

Based on this, here are three things you should do before 2025 to ensure the strength of your portfolio no matter what happens next in the market.

1. Keep cash readily available

Like Buffett, you should think ahead to future investing opportunities; for this, you'll need some cash. This shouldn't be part of your emergency fund -- that's to cover unplanned expenses that might come up in your daily life. Instead, this cash is meant for investing, should any good buying opportunities arise.

Don't sell off solid long-term stocks you love just to build up cash, though. Instead, make this cash growth plan part of your monthly savings routine. Even if you have to start small, setting aside a few dollars, that's fine.

As for exact cash levels, this depends on your investing and overall budgets. A general guideline is that cash should make up 2% to 10% of your portfolio. Once you have reached your cash level goal, you can sit back and watch the market, knowing you have funds to deploy at any time.

2. Diversify your portfolio

Technology stocks, led by artificial intelligence (AI) giants, clearly are driving gains in the stock market today, but this doesn't mean you should go all in on this industry and forget about others. It's important to diversify across sectors and stocks to maximize your chances for long-term gains -- and minimize the risk of losses. This way, if one industry suffers, your other investments may compensate. And by investing in various areas, you increase your chances of finding the next stock-market star.

You also might follow another bit of Buffett advice that will help you instantly diversify: That's buying an S&P 500 index fund, such as the SPDR S&P 500 ETF Trust (SPY -1.05%). Through this exchange-traded fund, you can invest in the 500 top stocks powering today's economy. Over time, the S&P 500 has delivered a 10% annualized average gain, making this a low-risk way to add diversification to your portfolio.

3. Think long-term

Buffett may not be an aggressive buyer of stocks these days, but this doesn't mean this top investor is abandoning the market. You shouldn't either. Like Buffett, remember to think long-term and not worry about short-term movements. When you sell a stock, it shouldn't be out of panic but for a good reason -- perhaps you want to lock in profits, or shift to another investment that you believe is more compelling.

As an investor, you'll invest through more than one bull market and bear market over your lifetime, and you shouldn't use those cycles alone as reasons to buy or sell.

Instead, during any market cycle, it's important to follow Buffett's advice to buy solid stocks at reasonable prices and hold on for the long term. This is how he has scored many of his victories over time. And it's how you can win as an investor too -- starting now in 2024, and into 2025 and beyond.