Warren Buffett's No. 1 investment rule is "never lose money." But no investor gets it right all the time. Not even Buffett.

Even if you look at Berkshire Hathaway's (BRK.A 1.18%) (BRK.B 1.30%) stock portfolio now, you can see some losers. Buffett has acknowledged overpaying for Berkshire's massive stake in Kraft Heinz, and Berkshire bought shares of Brazilian fintech StoneCo shortly after it went public at $24 and it currently trades for about $8.70.

Don't forget about Berkshire's stakes in the four major airlines, which Buffett decided to pull the plug on at a substantial loss. There have been several other investment decisions, both in the stock market and in the acquisition sides of the business, that Buffett and Berkshire's team no doubt wish they could have a do-over on.

Don't dwell on your losers

In his recent letter to Berkshire Hathaway shareholders, Buffett acknowledged that he hasn't hit home runs all the time. In fact, he said that in "58 years of Berkshire management, most of my capital-allocation decisions have been no better than so-so." Buffett believes Berkshire's long-term outperformance -- total returns of about 3.8 million percent since 1964 -- are due to "about a dozen truly good decisions."

Buffett specifically mentioned Berkshire's large investments in both Coca-Cola and American Express. Both stakes were purchased for about $1.3 billion in 1994 (Coca-Cola) and 1995 (Amex).

Thanks to steady and reliable growth, Berkshire's shares of these two companies have soared to $47 billion in value. And the company receives more than $1 billion in annual dividend income between the two, which can then be reinvested in opportunities that Berkshire finds. Best of all, investments like these overshadow the relatively poor performance of some of Berkshire's investments that remained in the $1 billion ballpark.

Apple has been a more recent home run, with Berkshire sitting on about $100 billion in gains. With gains like this from its largest investment, do you think Buffett or any of Berkshire's other managers are losing sleep over the fact that the StoneCo investment has declined by about $200 million? I don't.

Buffett concluded the discussion in his annual letter with an important lesson for investors to learn: "The weeds wither away in significance as the flowers bloom. Over time, it takes just a few winners to work wonders."

Here's why it's so important to learn this lesson

Let's face it, after the sharp market downturn in 2022, many investors have at least a few losers in their portfolio, and that's especially true if they have a technology-heavy portfolio or bought a few companies (like I did) that went public via SPAC. I own shares of two SPACs that went public at $10 per share and now trade for less than $1. Thankfully, I only opened small positions in both, but it still stings.

The point is that it's very easy for investors to get discouraged in situations like this. And it can certainly make you feel like a lousy investor if a stock you felt confident in plunges by 50%, 70%, or even more.

But you don't need to be discouraged as long as you properly diversify your portfolio, use appropriate position sizes (especially in speculative or volatile stocks), and learn from your losses. Even incredible stock-pickers like Warren Buffett aren't immune to making bad investment choices, but it's important to realize how insignificant short-term losers can be with just a few long-term winners.

Think of it this way: Do you think anyone who bought Amazon.com stock in the 1990s and held those shares cares that they also had money in a few tech-boom start-ups that went to zero? Or would someone who invested in Tesla's IPO still be sad if they had also bought shares in another EV start-up that didn't perform as well? I'd be willing to wager that investors in either of these situations don't even think about the investment decisions that didn't work out in their favor.