Warren Buffett has demonstrated his understanding of the market over the long term -- and his ability to turn that knowledge into wise investing decisions. As chairman of Berkshire Hathaway, he helped deliver a compounded annual gain of more than 19% over the past 58 years -- largely beating the S&P 500, which has posted a 10% such increase over that time period. Buffett has become so good at navigating the stock market that he's often referred to as the "Oracle of Omaha."

This long-term investing success has prompted investors to flock to the investing giant for clues about what may be next for the stock market and how to prepare for it. It's important to keep in mind that Buffett's words and actions don't always follow the path of the majority. This top investor doesn't mind going against the crowd. For example, in Buffett's shareholder letter following the 2000 market crash, he wrote: "Last year, we commented on the exuberance -- and, yes, it was irrational -- that prevailed, noting that investor expectations had grown to be several multiples of probable returns."

Now let's consider Buffett's actions in 2024. In the first three quarters of the year, as the S&P 500 soared, he took steps that could be seen as a warning to Wall Street. Berkshire Hathaway reached a record cash level of more than $300 billion, or 28% of its asset value. That's the highest percentage in more than 30 years. On top of this, Buffett has been a net seller of stocks for several quarters, and has even decreased his positions in certain favorite holdings such as Apple.

With this in mind, here's what to do as 2025 gets started to, like Buffett, position yourself for a long-term win.

Warren Buffett at an event.

Image source: The Motley Fool.

Go for value

As markets rose last year, stocks as a whole may be viewed as expensive. The S&P 500 Shiller CAPE ratio, an inflation-adjusted valuation measure that considers price and earnings per share over 10 years, has climbed higher than 35. It's only done this two other times since the launch of the S&P 500 as a 500-company index in the late 1950s.

S&P 500 Shiller CAPE Ratio Chart

S&P 500 Shiller CAPE Ratio data by YCharts.

But this doesn't mean all stocks are pricey. Many players, even ones that have advanced, still trade for interesting valuations. For example, Meta Platforms (META -1.95%) trades for only 23x forward earnings estimates, making it one of the cheapest of the high-growth technology stocks known as the "Magnificent Seven." Meta has delivered double-digit revenue gains in the past several quarters, and its investment in artificial intelligence (AI) could make it a big winner down the road.

You could also look to stocks that have underperformed but could be set for recovery. Pfizer (PFE 0.89%) stock has stumbled, leaving it trading for 9x forward earnings estimates, as demand for its coronavirus products waned. But the pharma giant has launched many new non-COVID products and aims to grow its oncology business in the years to come.

Buffett has still been selectively buying stocks when he sees value. In the third quarter of 2024, he added Domino's Pizza and Pool Corp. to his portfolio. So, even in a pricey environment, you still can find value, offering you buying opportunities at any moment.

Don't get too caught up in trends

I probably don't have to tell you that AI was one of the big drivers of stock market gains last year. Investors piled into companies that were creating tools to make AI work and companies that were using AI to improve their operations.

This investing theme is likely to continue for quite some time, considering that we're in the early days of the AI story. Today's $200 billion AI market is forecast to reach more than $1 trillion by the end of the decade. So, there's clearly room for AI companies to continue growing earnings, and stock performance may follow.

However, even though this trend doesn't look like a short-term one, it's still important to take a balanced approach to investing. Don't get too caught up in one particular trend and go all in on it. For example, it's risky to invest only in AI stocks and ignore other companies and industries. If AI stocks don't perform as well as expected or reach a rough patch, your portfolio could suffer.

Instead, diversify across a variety of industries and investment themes, so that if one underperforms, others could compensate.

Focus on the long term

We all hope our portfolios will soar in 2025, but what's even more important is performance over the long term. By this, I mean at least five to 10 years. So, instead of focusing on a company's potential just this year, consider potential catalysts several years down the road.

It may be worth picking up a player at a good price today that has what it takes to progressively increase earnings over time. That could lead to gains in the share price over the long run, too.

Warren Buffett once said: "If you aren't willing to own a stock for 10 years, don't even think about owning it for 10 minutes." He applies this to his own investing -- for example, he's owned Coca-Cola stock since the late 1980s.

As 2025 gets started, by following these three Buffett-style moves, you could set yourself up for success this year -- but most importantly, you're putting yourself on the right track to build wealth over time.