Investing legend Warren Buffett has offered plenty of stock picking advice over the years, but there's one notion of his that seems pertinent to the current market environment. Buffett encouraged investors to be “fearful when others are greedy, and greedy when others are fearful.”

With the S&P 500 down 12.6% year-to-date and the Nasdaq Composite trading almost 22% down, it's pretty clear there is some investment fear at the moment. So what stocks might offer an opportunity for long-term investors to get a little greedy at the moment? Looking at stocks that can be found in Buffett-controlled Berkshire Hathaway's portfolio, Amazon.com (AMZN 1.08%) and RH (RH 4.88%) seem to have what it takes to make great long-term picks. Let's take a look at these two Buffett stocks and learn a bit more about them.

Berkshire Hathaway CEO Warren Buffett speaks to reporters during a Berkshire Hathaway presentation in Omaha, Nebraska.

Image source: The Motley Fool.

1. Amazon 

E-commerce giant Amazon.com has seen its share price drop 23.6% year-to-date as macroeconomic headwinds like inflation and supply chain challenges disrupt its retail operations. But some of the reason for that drop has more to do with short-term comparisons to the prior year when Amazon was generating a lot of overperformance related to the pandemic. Long-term investors should see this dip as a buying opportunity because Amazon still has a massive addressable market to go after and a diversified business model to fuel outsized growth. 

Inflation is the increase in prices for goods and services over time. The current outsized inflation has been a big challenge for Amazon on two fronts: it raises operating costs for Amazon's e-commerce business and it also erodes the purchasing power of Amazon's customers. Amazon's first-quarter results highlight these challenges. Operating cash flow fell 41% year over year to $39.3 billion despite a 7% increase in sales to ($116.4 billion).

The good news is these aren't permanent problems. And while it is unclear how long the inflation headwind will last, investors with a multi-year investment horizon shouldn't be too worried. Analysts at Grand View Research expect the global e-commerce market to expand at a compound annual growth rate (CAGR) of almost 15% through 2027. Amazon's scale and infrastructure make it well-positioned to benefit from this trend.

As it spends money to capture that e-commerce growth, Amazon has other revenue streams to maintain its profitability. Amazon Web Services' (AWS) cloud computing business provides much-needed diversification. AWS's first-quarter sales grew 37% year over year to $18.4 billion, while the segment's operating income surged 57% to $6.5 billion, helping to make up for the short-term challenges in Amazon's retail business. 

2. RH 

RH, formerly known as Restoration Hardware, is a furniture store transitioning into a luxury lifestyle brand. While the stock price is down by a staggering 43% year-to-date, its promising international expansion and now dirt-cheap valuation mean its long-term bull thesis remains intact.

RH's fiscal 2022 first-quarter (ended April 30) revenue increased 11% year over year to $957 million, while net income increased 54% to $201 million. But despite the year's strong start, management has a sober outlook for the second quarter, guiding for a revenue decline of 1% to 3% year over year because of ongoing macroeconomic challenges such as supply chain disruption. Management said they expect these headwinds to continue for the next several quarters, but believe RH's investments will help drive its long-term success. 

These investments include an ambitious international expansion plan that involves opening stores in England and France this year. This expanded footprint will boost RH's revenue opportunities while also taking it closer to its goal of becoming a global luxury brand.

With a forward price-to-earnings (P/E) multiple of just 10.4, RH is valued significantly lower than the S&P 500 average of 18, making now a potentially good time to bet on the company's long-term prospects. 

Bargain hunting 

While market sell-offs can be unnerving, they tend to make top stocks cheaper compared to their previous highs. Amazon and RH admittedly face near-term challenges, but their long-term bull theses remain intact. Amazon's fast-growing cloud computing business gives it much-needed diversification during this challenging retail environment. And RH's dirt-cheap valuation makes it a promising company trading at a rare discount. These two Buffett stocks are worth a closer look and a potential long-term buy-and-hold.