If anyone knows how to navigate different economic cycles, it's the Oracle of Omaha, Warren Buffett. Since taking over at Berkshire Hathaway in 1964, Buffett has delivered investors an eye-opening 3,641,613% return, or more than 20% annually.

Buffett has survived -- and thrived -- through eight recessions since that time. Buffett's secret to long-term success is quite simple: Invest in high-quality companies that offer a margin of safety and hold on to your winners as long as they continue to produce.

This year has been challenging for investors, but it's a good reminder that high-quality companies can withstand bad economic conditions thrown at them. Here are two top-notch Buffett stocks you can buy today -- and one you should avoid for the time being.

Buy: Visa

Visa (V 0.08%) helps people across the globe spend and move money through its debit cards, credit cards, and other payment methods. The company holds a sizable lead in the payment processing market, helping facilitate $9 trillion in payments in 2020 -- over 90% more than its next closest competitor, Mastercard

Visa stock is appealing for a few reasons. For one, the company has built strong network effects over the years, helping coordinate the movement of money from banks to consumers to merchants worldwide. The business is also relatively asset-light, meaning it doesn't need to spend all that much money on equipment or inventory. This helps the company generate strong cash flows on high profit margins -- averaging 45% over the last decade.

During the last year, Visa's free cash flow, or cash left after paying for operational expenses and capital expenditures, was nearly $18 billion. This is cash left over that Visa can use to pay dividends, buy back shares, or reinvest in the business to make acquisitions.

Charts showing Visa's profit margin and free cash flow rising since 2014.

V Profit Margin data by YCharts

Visa has done well this year despite the inflationary environment. During its fiscal year, which ended Sept. 30, Visa saw total revenue grow by 22% and earnings per share increase by 24%, showing the company's resilience despite economic uncertainty. 

Chief Executive Officer Al Kelly noted that while there have been some changes in consumer behavior, spending remains robust and continues to increase. In the last year, consumer payments were up 20% thanks to an uptick in travel and entertainment spending. 

Visa has been a top performer for years and is well-positioned to keep thriving regardless of the market -- making this Buffett stock a solid one to add to your portfolio today.

Buy: Marsh & McLennan

Marsh & McLennan (MMC 0.07%) advises companies on managing risks, finding the right insurance policies, and navigating workplace issues. Risk and insurance services comprise about 60% of the company's total earnings, with the remainder coming from consulting.

For decades Marsh & McLennan has been a trusted advisor to companies, helping them navigate a changing world. This year the company has benefited from the uncertain economic environment as companies deal with supply chain issues, market volatility, inflationary pressures, and a transition to green energy.

This is when the company thrives, with CEO Dan Glaser saying: "When the world is unsettled, demand for our service rises." Through nine months this year, Marsh & McLennan's revenue rose by 7% and diluted earnings per share increased by 12%. 

Marsh & McLennan is ready to succeed whatever the market cycle, so the threat of an upcoming recession doesn't concern it too much. According to Glaser, the company has boosted its earnings per share during every recessionary period since 1962, making it another excellent Buffett stock to buy and hold for the long haul. 

Avoid: Nu Holdings

One Buffett-backed stock to avoid right now is Nu Holdings (NU 1.67%). Nu Holdings offers low-cost, easy-to-use digital banking services in Brazil. The bank went public last year and has since seen its stock lose 60%.

The company isn't your typical Buffett stock. Buffett is a big fan of bank stocks because they tend to have relatively low valuations and a margin of safety that makes them a good place to put your cash. However, Nu Holdings isn't cheap by any means.

The bank trades at a one-year forward price-to-earnings ratio (P/E) of more than 80 and a price-to-book value of 4.8. To put this in perspective, the more typical Buffett holding, Bank of America, trades at a one-year forward P/E of 10 and 1.2 times book value.

Nu's expensive valuation reflects the explosive growth potential of the stock. Nu Holdings has achieved impressive top-line growth, with revenue of $1.2 billion, up 244% in the second quarter thanks to growth in monthly active users and cross-selling to existing customers. 

However, the Brazilian fintech also saw losses nearly double from the year before as higher interest costs, general expenses, and allowance for credit losses ticked up. Given its expensive valuation and uncertainty in the global economy, this is one Buffett stock you should avoid for the time being.