If you start investing early enough, you should have a fair shot at being able to build a well-padded nest egg for retirement. Even current retirees who are fretting about lost portfolio value now, should be OK if they started early and invested consistently over time.

It's also a smart idea to have a strategy in place ahead of any market downturn that will help you weather the storm until it blows over and values recover, even if you need to free up some of your funds in the interim.

Indeed, while seeing a bear market play out in reality can be scary in one sense, it should also encourage younger investors to look at the bigger picture and think about their future.

If you have $5,000 available to invest now (and if you've paid off your high-interest-rate debts and built up an emergency fund), I'd suggest you consider buying shares of Amazon (AMZN -2.99%) and Costco Wholesale (COST -2.50%).

There's no telling what Amazon will do next

Amazon has been one of the highest-performing stocks ever over the long haul because of its willingness to take risks and pursue new revenue streams. It has long trailed Walmart as the largest U.S. company by sales, but its incredible growth during the pandemic narrowed the gap.

WMT Revenue (TTM) Chart

WMT Revenue (TTM) data by YCharts.

It has several advantages over Walmart, although Walmart knows this and is making efforts to become more like Amazon all the time. There are now more than 200 million Amazon Prime members, and as the company works to improve its delivery times and add more services, those members engage more with the company and fuel higher growth.

Walmart was slow in moving into the e-commerce and omnichannel arenas, and although it now offers its own subscription membership service, it's nowhere near as large as Amazon Prime. 

Amazon has been struggling during this sluggish economy due to higher costs and pressured profits, but sales were brisk in the third quarter, up 15% year over year. It's projecting slower fourth-quarter growth, which investors weren't too thrilled to hear. But there's no reason to sweat one quarter, especially in the current operating environment.

Amazon is expanding its empire and setting itself up to rake in high sales from several paths for many years. Amazon Web Services has become an important and profitable part of the business, and the company is developing a healthcare business that could be its next big revenue generator.

It's building out several other businesses as well, such as its "just walk out" technology for brick-and-mortar retail. Investors should expect the company to keep growing and its stock to keep gaining for many years. And Amazon stock is down 47% this year, making it an excellent time to buy shares. 

Costco offers slow and steady growth

Costco has historically been a slow-growing company, but over time, it has beaten the market by a wide margin. 

COST Chart

COST data by YCharts.

Its sales growth may have been slow, but it's been dependable. And over the past two years, it's been incredible.

Costco often demonstrates its best performance under harsh conditions, and that has been the case again over the past three or so years. It has built up a loyal base of members who shop at its warehouses to get the best prices even in good times, but favor it even more in challenging times. 

Something I really like about Costco is the rate at which it opens new stores. It has plans to open 24 in fiscal 2023, and it opened seven in the fiscal first quarter, which ended Nov. 20.

Many retailers grow at a much faster rate, and while that can add revenues rapidly, it also piles on expenses and pressures profitability. A slower pace of store openings ensures that scaling is done with efficiency, and it also provides a long growth runway.

Costco operates 847 stores globally, with 583 in the U.S. Sales growth comes from new stores, but also healthy comparable sales, and it delivers that top-line growth while improving profitability.

Costco stock fell last week after it delivered its fiscal 2023 first-quarter earnings report, which featured slowing top-line growth after two years of soaring sales.

It's now down 15% for the year and trades at 37 times trailing-12-month earnings. Shareholders should enjoy the benefits of owning Costco stock, including its dividend payouts, well into the future.