Warren Buffett, one of the greatest investors of all time, has been a bit subdued during the coronavirus pandemic. Not because he's afraid -- he's still optimistic, and told investors at the 2020 annual meeting of Berkshire Hathaway (BRK.A 0.64%) (BRK.B 0.54%) to "never bet against America." But he hasn't been seeing great opportunities, even during the current recession. "We have not done anything, because we don't see anything that attractive to do," he said.

Still, as he nears his 90th birthday in August, Buffett is as mentally sharp as ever, and he's given no indication of retiring anytime soon. And why should he? Since Berkshire Hathaway started trading publicly in 1965, the stock has rewarded investors with a 20.5% average annual return.

Are you curious how he did it? By reviewing his investing style, investors can get insight into building a market-beating portfolio. Here are seven lessons from Buffett to help you be successful.

Warren Buffett being photographed at the Berkshire annual meeting.

Image source: The Motley Fool.

1. Invest with discipline

One of the key principles Buffett follows is to maintain discipline when purchasing companies. He makes his rules and sticks by them. According to the billionaire:

You will notice that our major equity holdings are relatively few. We select such investments on a long-term basis, weighing the same factors as would be involved in the purchase of 100% of an operating business: (1) favorable long-term economic characteristics; (2) competent and honest management; (3) purchase price attractive when measured against the yardstick of value to a private owner; and (4) an industry with which we are familiar and whose long-term business characteristics we feel competent to judge. It is difficult to find investments meeting such a test, and that is one reason for our concentration of holdings.

Buffett has had the discipline over the long term to avoid purchasing companies that didn't fit into the above criteria. "We simply can't find 100 different securities that conform to our investment requirements. However, we feel quite comfortable concentrating our holdings in the much smaller number that we do identify as attractive."

2. Buy what you know

Buffett has famously said, "Never invest in a business you cannot understand." That doesn't mean you should avoid an investment because it's outside your area of expertise. But you need to be able to give it a proper valuation. If a company's business is outside your area of competence, it's best to avoid it.

As Buffett said in his 1996 shareholder letter

What an investor needs is the ability to correctly evaluate selected businesses. Note that word "selected": You don't have to be an expert on every company, or even many. You only have to be able to evaluate companies within your circle of competence. The size of that circle is not very important; knowing its boundaries, however, is vital.

Buffett's circle of competence includes financial stocks like Wells Fargo and consumer discretionary stocks like Coca-Cola, which explains why he was reluctant to invest in technology stocks for a large part of his career. But on May 15, 2016, he took the leap and purchased 9,811,747 shares of Apple for $108.99 a share. On May 15, 2020, Apple closed at 307.71 -- a gain in share price of 182%. Not too shabby for someone who originally resisted investing in tech.

Emotional woman with a frightened look and her hands on her mouth.

Image source: Getty Images.

3. Don't buy into the market's emotionality

According to Buffett, it's important to stay calm as an investor. "Remember that the stock market is a manic depressive," he says.

You can do this by buying great companies with strong fundamentals and keeping your eye on the long term. Markets will rise and fall for many reasons, but most of the declines will be relatively temporary. It's important not to be manic depressive along with the markets. You do this by keeping your eye on the future and ignoring short-term market gyrations.

4. When opportunity knocks, open the door

Buffett wrote in his 2016 shareholder letter: "Every decade or so, dark clouds will fill the economic skies, and they will briefly rain gold. When downpours of that sort occur, it's imperative that we rush outdoors carrying washtubs, not teaspoons."

Remember that old stock market adage, buy low and sell high? If you're patient, you'll have plenty of opportunities to purchase great stocks at bargain-basement prices. That's one reason to make sure you have a percentage of your portfolio in cash, so that when a temporary fire sale occurs, you're in a position to take advantage of it.

Door opening, and money pouring out of it.

Image source: Getty Images.

5. Invest for the long term

Buffett believes that investors should feel like they're part owners in the companies they buy for their portfolios. In his 1996 investor letter, he wrote, "Your goal as an investor should simply be to purchase, at a rational price, a part interest in an easily understandable business whose earnings are virtually certain to be materially higher 5, 10, and 20 years from now."

Holding for the long term is key, and the best way to accumulate wealth. "If you aren't thinking about owning a stock for 10 years, don't even think about owning it for 10 minutes," Buffett said.

6. Index funds are an investor's friend

Buffett is a huge fan of index funds. So much so, that he has directed his trustees to put 90% of his wife's inheritance in them when he passes. As he shared in his 2013 annual shareholder's letter:

My advice to the trustee couldn't be more simple: Put 10% of the cash in short-term government bonds and 90% in a very low-cost S&P 500 index fund. (I suggest Vanguard's.) I believe the trust's long-term results from this policy will be superior to those attained by most investors -- whether pension funds, institutions or individuals -- who employ high-fee managers."

He reiterated that advice at the 2020 annual meeting: "In my view, for most people, the best thing to do is owning the S&P 500 index fund."

A man in business suit holding a card that says TIME TO SELL.

Image source: Getty Images.

7. Don't be afraid to sell losing stocks

Although he's said over and over that he invests for the long term, Buffett's not afraid to sell if fundamentals have changed and he's no longer optimistic about an industry. Such was the case in April, when he sold Berkshire's approximately $4 billion position in the airline industry, which was being ravaged by the coronavirus pandemic.

Why did he sell? According to the Oracle of Omaha:

The world has changed for the airlines. And I don't know how it's changed and I hope it corrects itself in a reasonably prompt way. I don't know if Americans have now changed their habits or will change their habits because of the extended period.

Even great investors make mistakes, but it's important that you recognize when you've made one and get out of the investment before it creates even further losses.

There's no guarantee that these insights will help you average a 20.5% annual return on your investments over the long term. But they might... and they might even return more if your circle of competency happens to be in growth stocks in the technology arena. But using Buffett's advice can serve as a guide to put you on the road to a very successful investing career.