Congratulations! You've done the hard work of setting aside cash that can be put toward your future. Taking money that you won't need for several years and investing it in stocks is a great way to build your wealth over time, but you need to be smart about it. Rather than buying the hot-tip stock you heard about from your uncle, investing in well-run companies you are familiar with is a better way to build a solid foundation for your portfolio. 

Three stocks that can help you get started investing this year are Amazon (AMZN 1.49%), Mastercard (MA 0.30%), and Home Depot (HD 0.22%). Let's take a look at why these three can be a great way to start your investing journey and I'll wrap up with a thought that can improve your odds of success.

Amazon: E-commerce and web services

Amazon has grown considerably since it started selling books online 25 years ago. It has built a fast and reliable fulfillment network, with just about anything you want to buy available on its website (including groceries), and also has a massive cloud hosting business (Amazon Web Services). In recent months, the pandemic has made it clear that e-commerce is here to stay, and Amazon leads the way as the go-to choice for consumers.

Last quarter, its U.S. and international e-commerce segments grew 43% and 41% year over year, respectively, on a constant-currency basis, and its web hosting segment grew 29%. Despite spending $4 billion in COVID-19-related safety measures for employees, it posted an incredible $5.2 billion net income, double that of the previous year. Its trailing-12-month free cash flow grew to an amazing $31.8 billion, up 29% from the previous year.

If buying one share of the stock for more than $3,000 is too big a commitment, think about investing a smaller amount. This can be done through a brokerage firm that allows fractional share purchases.

Mastercard: Taking a cut of every transaction

In the first six months of 2020, customers swiped their 2.2 billion Mastercard-branded credit and debit cards more than 52 billion times, spending an astounding $2.2 trillion. The company's revenue comes from a small cut of each one of these transactions. This is an incredible revenue generator when the economy is booming, but with the global pandemic keeping businesses closed and forcing many people out of their job, people have curtailed spending, and that affected the results of the quarter ending June 30.

Revenue was down 17% year over year on a currency-neutral basis, which reduced net income 29%. The company is still profitable, posting $1.41 earnings per share, down from $2.00 in the year-ago quarter.

Small green plant growing out of coins that have come out of a jar that's fallen over.

Image source: Getty Images.

But the coronavirus has had positive effects, too. CEO Ajay Banga said in the most recent earnings call, "The COVID crisis has driven an acceleration in the use of electronic forms of payment with much greater adoption of digital and contactless solutions." This bodes well for Mastercard's future. As this crisis will eventually be in our rearview mirror, spending will pick up, and revenues will start to grow again.

Home Depot: Adapting to every challenge

With people stuck at home, many chose to work on home improvement projects, which boosted sales for this DIY retailer. In the quarter ending May 3, overall revenue rose 7.1%, as compared to 5.2%in the previous quarter and 5.7% from the same quarter a year ago. The company spent $850 million on employee-focused COVID-19 benefits and safety measures, but still had $2.2 billion, almost 8% of revenue, drop to the bottom line.

The company has a growth strategy focused on improving the throughput of its stores. Since 2015, the company's only added 19 stores for a total of 2,293, but its sales per square foot have jumped from $371 to $467, an impressive 26% increase. This efficient use of its floor space provides the retailer with tremendous cash flows, racking up over $12 billion in free cash flow the last 12 months.

Investors like that this quality operator seems Amazon-proof and pandemiic-proof.

Then what?

Hopefully, you are ready to jump in and buy shares of high-quality stocks. But then what? Look no further than the advice of successful investor and businessman Warren Buffett, who said: "If you aren't willing to own a stock for 10 years, don't even think about owning it for 10 minutes."

Day to day, stock prices can vary widely, but if you look over the longer term, you get a very different picture. The chart below shows how these three stocks have fared over the past 10 years.

AMZN Chart

AMZN data by YCharts

This demonstrates that the longer you held these winners, the more they rose against the S&P 500, a measure for the returns of the broader market. Going forward, these stocks may not bring the same level of gains that they've had in the past, but if you hold your stocks for the long term (think decades) and add to your positions over time, it will increase your chances of success.