Last year, all three major indexes touched bear territory. Though they've rebounded from their lows, the market environment remains tough. Interest rates are on the rise. Higher inflation continues to be a concern. And those elements weigh on companies' earnings prospects. All of this probably has you wondering if you really should buy stocks right now.

For advice, it's always a good idea to turn to one of the world's favorite investors, Warren Buffett. Why? He's led Berkshire Hathaway to a compounded annual gain of nearly 20% over the past 57 years. That's compared to the S&P 500's increase of 9.9%. Buffett has been through his share of market downturns and crashes, yet still has delivered excellent returns. So, he's sure to offer wise words...

Buffett's strategy

First, a quick refresher on Buffett's investment strategy. He believes in buying quality stocks and holding on for the long term. He aims to snap up these companies for a price that's lower than their intrinsic value, or what they truly are worth. The idea is the market eventually will recognize the quality company's value -- and the stock should rise.

Now, let's move on to some words from Buffett that may guide us during these tough investment times. In his 2016 letter to shareholders, Buffett advised investors never to forget two things during "scary periods."

"First, widespread fear is your friend as an investor, because it serves up bargain purchases," Buffett wrote. "Second, personal fear is your enemy. It will also be unwarranted. Investors who avoid high and unnecessary costs and simply sit for an extended period with a collection of large, conservatively financed American businesses will almost certainly do well."

In the first part of the quote, Buffett talks about general fear being our friend. That's because this fear pushes many to sell shares of quality companies -- and as a result, valuations of these companies drop. This offers us the opportunity to scoop up top players for a song -- and then benefit from their recovery and growth over the long term.

Two market leaders

Potential opportunities today include Amazon (AMZN -1.64%) and Intuitive Surgical (ISRG -0.55%).

Amazon stock plummeted as rising inflation weighed on the company's costs -- and on its shoppers' wallets. It may take some time for earnings and the stock price to recover. But I'm confident it will. Amazon is a leader in two high-growth markets -- e-commerce and cloud computing -- and the company is taking the necessary cost management steps today to succeed over time.

Today, Amazon is trading for 1.8 times sales, its lowest since 2015.

AMZN PS Ratio Chart

AMZN PS Ratio data by YCharts

Intuitive slipped as coronavirus interruptions weighed on its sales of surgical robots and accessories to hospitals. And supply chain disruptions added to the woes. But the company dominates the market and has a tremendous moat. So there's reason to be optimistic about the long term -- and the long term is indeed Buffett's favorite investment horizon.

Intuitive is trading at 42 times forward earnings estimates. That's down from more than 60 a year ago.

Buffett and Coca-Cola

As for the second part of the Buffett quote: Personal fear is our enemy because in tough times, it will push us to do things we probably shouldn't, like sell a quality company just because it's declining. As Buffett says, you're better off ignoring overpriced stocks and instead holding on to good businesses "for an extended period."

Buffett started buying shares of one of his favorite companies, Coca-Cola (KO 1.50%), in 1987 and finished in 1994. Though the beverage giant generally climbed during that period, there were moments when the shares stagnated or declined.

KO Chart

KO data by YCharts

But Buffett held on and even added to positions. He believed in the Coca-Cola story and stuck by it. Patience paid off. Not only has the share price increased since that time, but dividend payments have too. Back in 1994, Berkshire Hathaway collected a dividend of $75 million from Coca-Cola. Today, that dividend payment has reached $704 million.

So, considering Buffett's quote and his general investing strategy, it's clear that today is a fine time to invest. Valuations of many quality companies have dropped, offering you great entry points. Even if the stock doesn't rebound right away, that's OK. Like Warren Buffett, you're in this for the long haul. And like Buffett, you may reap rewards down the road too.