Some retirement savers might be wondering whether it's a good time to invest, given all the uncertainty in the markets and economy right now. But ups and downs in the markets are quite common. The key is not market timing but sticking with strong companies over the long term.

For example, if someone had invested $100 in the S&P 500 in 1927 -- just a few years before the Great Depression sent the markets crashing -- they would have slightly over $1 million today.

Stock chart with a turtle figurine lying on top.

Image source: Getty Images.

Even the worst market timer can get filthy rich in the stock market. All you have to do is put your money to work in growing companies with bright prospects and let time take care of the rest.

Plenty of quality stocks are on sale after last year's market sell-off. Two to consider buying today are Home Depot (HD -0.60%) and South Korea's leading e-commerce provider Coupang (CPNG 0.53%). Here's why these stocks are good long-term investments.

Home Depot: A solid income stock

Worries over the fate of the home improvement market weighed on Home Depot stock last year, but the company is proving to be more resilient in this environment than even management expected.

The main concern was high inflation and whether that would cause lower spending on home projects. This hurt the company's momentum, with sales in the fourth quarter growing just 0.3% over the same quarter a year ago. But steady sales volume is all Home Depot needs right now. There will always be ups and downs in the economy. The most important thing is Home Depot's rock-solid performance on the bottom line.

In the fourth quarter, the company managed to dodge higher input costs that have hurt other retailers by reporting a 3% year-over-year increase in earnings per share. The recent investments to improve store productivity and the supply chain are clearly paying off.

Meanwhile, the stock is trading low enough to offer plenty of upside over the next five years and beyond. On a price-to-earnings basis, the stock traded as high as 22 times forward earnings estimates a year ago but now trades at just 18.5 times this year's earnings estimate. That basically means investors are getting a greater share of the company's earnings for less money.

Moreover, a lower stock price has driven Home Depot's dividend yield up to 2.67% at the time of writing, compared to the S&P 500's yield of 1.56%. The company just raised its quarterly dividend by 10% to $2.09 per share and has been paying a dividend for 36 years.

Coupang: An undervalued e-commerce platform

Coupang is a leading e-commerce platform in South Korea with an attractive long-term growth opportunity. South Korea has a well-developed e-commerce market, where online spending makes up 37% of all retail shopping -- more than double the online penetration in the U.S.

Coupang's quarterly revenue has more than doubled since the fourth quarter of 2019 to over $5.3 billion. While growth slowed last year, Coupang reported a 5% increase in active customers, with older customer groups spending more with the company.

The stock fell last year due to an expensive valuation at the start of the year, ahead of slowing growth. Management has continued to build a sophisticated infrastructure to handle growing orders and shipments to customers, so it hasn't reported a profit yet, but Wall Street is not fully appreciating the company's future prospects.

On a price-to-sales basis, the company sells for just 1.37 times trailing revenue -- down from a valuation of over 6 times sales a few years ago. Coupang trades at a discount to other top e-commerce stocks, such as Amazon, Etsy, and eBay, which trade at over 2 times trailing revenue. This indicates Coupang is undervalued and could climb higher over the next few years.

Management has invested to build the country's largest fulfillment infrastructure and its leading last-mile delivery network. With these heavy investments out of the way, profits are improving rapidly. The company ended the year with a profit margin just below breakeven, setting the stage for profitable growth over the next several years.