In recent weeks, it was easy to observe the dangers of short-term investing. In the blink of an eye, the three major benchmarks -- which had climbed over the past two years -- suddenly found themselves in the doldrums. The S&P 500, the Dow Jones Industrial Average, and the Nasdaq Composite each slid in March and April on concern that President Trump's import tariffs would hurt economic growth.
Investors who aimed to sell stocks they recently bought may have found themselves in a difficult situation. But the picture for those who buy and hold on for the long term looked a lot brighter. History shows us that the indexes always have gone on to win over the years. So times of declines represent great buying opportunities -- you'll get in on quality stocks for reasonable prices and potentially set yourself up for a win farther down the road.
With this in mind, let's consider two monster stocks that you'll want to hang onto for decades. They've proven their ability to grow earnings and share price performance over time, have solid competitive advantages, and are heading for ongoing success.

Image source: Getty Images.
1. Amazon
Amazon (AMZN -0.31%) has built leadership in e-commerce and cloud computing, two areas that helped net sales climb to $638 billion in the latest full year. And this isn't an exception. Amazon has generally grown revenue, net income, and return on invested capital over the years.
AMZN Revenue (Annual) data by YCharts
And when Amazon saw earnings drop because of rising inflation a few years ago, it revamped its cost structure -- a move that helped it return to profit in a year. This move also was smart as it set Amazon up to operate more efficiently throughout any market environment. One big part of this was shifting U.S. fulfillment from a national to a regional system. By bringing items closer to the customer, Amazon has saved on costs and has boosted its ability to deliver faster -- something that pleases customers.
Amazon's fulfillment network worldwide as well as its Prime subscription program, which offers regular customers many benefits, are part of the company's solid moat or competitive advantage. Moats are something to look for when you aim to invest for the long term as they signal a company has what it takes to maintain its market position.
We can't end a conversation about Amazon without mentioning its cloud business, Amazon Web Services (AWS). After all, this business drives profit for the entire company. AWS is the world's leading cloud company, and in recent years, it's gone all in on the high-growth technology of AI. The cloud business offers a wide range of AI products and services to customers, and that's helped it achieve an annual revenue run rate of $117 billion.
Today, Amazon shares trade for 33 times forward earnings estimates, down from more than 42 late last year, making it an excellent player to scoop up right now.
2. Coca-Cola
While indexes were struggling in recent weeks, Coca-Cola (KO 0.98%) took the opposite path, advancing 15% so far this year. Why have investors flocked to this player? As the world's biggest nonalcoholic beverage maker and a dividend powerhouse, Coca-Cola offers investors elements of safety during tough times.
Thanks to its solid brands -- from the eponymous Coca-Cola to Minute Maid juices -- and its extensive distribution network, Coca-Cola has a strong moat. Coca-Cola often is the first name that comes to mind when someone thinks of soda, and its flagship drink is practically a staple in bars and restaurants around the world. The company also has continued to innovate, creating specific flavors and experiences for different markets to ensure growth. All of this makes it easier for Coca-Cola to advance through tough economic times.
As for dividends, Coca-Cola has shown its commitment to rewarding shareholders by boosting its dividend for more than 50 consecutive years. That's put it on the list of Dividend Kings. With this sort of track record, it's likely Coca-Cola will continue being a prominent dividend player.
Now, what about Coca-Cola's performance during better market times? It's true this beverage giant won't offer you the explosive growth you'll get from certain technology players or companies involved in cutting edge areas like quantum computing. But Coca-Cola over time has grown revenue and net income, thanks to the strong market position I mentioned, and looks reasonably priced today at 24 times forward earnings estimates -- all of this makes it a company you can buy with confidence and hold on to for decades.