Warren Buffett is arguably the greatest capital allocator ever, as his nearly 60-year track record running Berkshire Hathaway (NYSE: BRK.A) (NYSE: BRK.B) clearly demonstrates. Unsurprisingly, the Oracle of Omaha is closely followed even today by investors looking to bolster their portfolios. 

Berkshire's massive $364 billion investment portfolio owns many different businesses. However, I think two of them stand out and should be bought hand over fist by investors. There's also one company that I think should be avoided. 

Let's take a closer look at these Buffett stocks. 

Own the massive payments networks 

As of Aug. 7, Visa (V -0.23%) and Mastercard (MA 0.07%) were the 20th and 22nd largest holdings in the portfolio, respectively, worth a combined $3.6 billion. These are relatively small positions, but that doesn't mean the average investor should write them off. Both of these giant card networks possess favorable qualities. 

For starters, they continue to post strong growth even though economic uncertainty remains elevated. In its most recent fiscal quarter (the third quarter of fiscal 2023, ended June 30), Visa increased revenue by 12% year over year to $8.1 billion. Its payment volume jumped 9%. And as usual, profitability is superb, with a quarterly operating margin of 62%. 

Mastercard's latest financials paint a similar picture. It grew sales by 14% in its latest quarter (Q2 2023 ended June 30) to $6.3 billion. Payment volume of $2.3 trillion was 12% higher than the year-ago period. And the operating margin, while not at Visa's level, was still outstanding at 58%. 

It's challenging to find more profitable companies than Visa and Mastercard. And this outstanding financial position is made possible because of their tremendous scalability. Their technological infrastructure is already built, so every additional transaction that crosses their payment rails carries extremely low marginal costs. 

This situation also results in powerful network effects. With billions of cards in circulation worldwide, and accepted at tens of millions of merchant locations, Visa and Mastercard are valuable to all participants. And this makes it almost impossible that these businesses will be disrupted anytime soon. Investors can own these stocks for many years. 

While Visa and Mastercard have put up double-digit returns in 2023, they have lagged the S&P 500. But don't let this discourage you. Both stocks have crushed the broader index over the past five- and 10-year periods. And although their current valuations don't exactly look cheap, they still deserve a spot in your portfolio. 

Avoid this automaker 

General Motors (GM 0.48%) is a $1.5 billion position in Berkshire's portfolio, but investors should stay away from this stock. To be fair, the automotive business recently provided an upbeat financial update. Revenue of $44.7 billion was up 25.1% year over year. Management upgraded the outlook and now expects adjusted operating income of $13 billion (at the midpoint) this year. Moreover, it now thinks it can cut costs by $3 billion by the end of 2024, which should provide a boost to profitability.  

Despite the positive quarterly results, there are compelling reasons to stay far away from the stock. Investors can't forget that this is still an auto manufacturer, which has generally been a poor place to allocate capital. Margins are razor thin, as exemplified by GM's trailing five-year average annual operating margin of 5.3%. Competition is incredibly fierce, with numerous rivals all vying for consumer and commercial dollars, a harsh reality that will make it difficult to raise margins in the future. 

And this is a notoriously cyclical and capital-intensive industry. GM bulls might argue that the transition to electric vehicles will usher in heightened demand and more favorable pricing dynamics, but it's going to be extremely expensive to get to that point. Not to mention, every other car company is trying to do the same thing. Demand is also fully exposed to the state of the economy, with factors like consumer confidence, interest rates, and the unemployment rate all impacting GM's prospects. 

Even though GM shares trade at a price-to-earnings multiple of 5.1, which is well below its trailing-three-year average, investors should avoid adding the company to their portfolios.