After you've paid your bills, contributed to your retirement fund, and set aside an emergency savings fund sufficient to cover several months' worth of your household expenses, you may find you still have some funds available. That could be a great time to consider investing in the stock market.

At first, you may be a bit overwhelmed with all of your options, and there's a lot of advice out there that can compound the problem. Perhaps its better to just start simply with a couple of investments that will let you dip a toe into the world of Wall Street.

Here is some information about two ideal stocks that you can feel comfortable buying and holding as the basis for building your long-term portfolio.

Three people sitting at a table doing various things.

Image source: Getty Images.

1. Amazon: A dominant online presence

Amazon (AMZN 0.37%), which began as an online bookseller in the mid-1990s, has become so much more. It's now one of the world's most valuable companies, selling a vast array of goods at competitive prices both online and through physical stores.

Among the strategies that allowed it to achieve its enormous growth were putting the customer at the center of its focus and thinking long term. Those principles helped lead to innovations like Amazon Prime, its popular subscription service that includes free fast delivery and a video streaming service. The company has expanded into hardware devices like Alexa, cloud computing services like Amazon Web Services (AWS), and online advertising.

The days when this company steadily generated bottom-line losses while it poured money into expanding its revenue are long over. Amazon's operating income hit $22.9 billion last year, five-and-a-half times 2016's $4.2 billion. During that time, revenue nearly tripled to $386 billion -- an impressive long-term record.

Of course, the stock price, which has risen by more than 350% over the last five years to more $3,200, reflects this success. The trailing price-to-earnings ratio is 61, more expensive than the S&P 500's 45.

However, it is worth paying a more expensive valuation since future growth prospects remain bright for this dominant online company. Amazon's business is well-positioned to serve customers' needs as online shopping continues to increase, accelerated partly by the pandemic. In 2021's first quarter, its sales grew by about 44% to $108.5 billion, and operating income more than doubled to $8.9 billion. All of its businesses did well, including AWS, which saw its revenue grow by more than 30%.

Better still, the company continues to push ahead. It recently announced it would purchase MGM Studios for $8.5 billion, which will bolster its film library and Prime streaming service, among other benefits.

2. Johnson & Johnson: A relevant century-old company

Johnson & Johnson (JNJ -0.10%), which was founded in the 1880s, has become three strong businesses. Its pharmaceutical business, which produces drugs to treat various ailments, including arthritis, cancer, cardiovascular disease, and diabetes, accounts for 55% of annual revenue. Its medical devices segment focuses on products used in surgeries and orthopedics. And its consumer products division features a stable of well-regarded brands such as Band-Aid, Tylenol, and Nicorette.

These businesses tend to do well no matter what's going on with the economy. While the pandemic caused some disruption last year, demand is typically stable for medical services, treatments, and consumer goods.

In 2020, despite weakness in its medical devices division due to hospitals and patients postponing procedures, Johnson & Johnson's adjusted sales grew by 1.5% to $82.6 billion while earnings fell by 8%. The stock's roughly 20% total return over the last year was less than half the S&P 500's 41%.

However, as people began to resume more of their normal activities, momentum built in the second half, and that has carried over into this year. Its first-quarter sales rose by 6%, driving earnings 12.5% higher year over year. For the year, the middle of management's range calls for more than 9% sales growth and nearly 17% earnings growth.

Johnson & Johnson isn't a stodgy company, either. It invests heavily in research and development and has a number of drug treatments pending approval.

Investor takeaway

These are companies in very different stages of their life cycles. Amazon has exciting growth prospects, offering long-term appreciation potential. Johnson & Johnson is a mature business that keeps moving ahead steadily and consistently raises its dividends. Last month, its board of directors increased the quarterly dividend payment from $1.01 to $1.06 per share, extending its annual streak of raising its dividend to 59 straight years. The stock currently yields 2.5% on its dividend. Needless to say, you won't regret having both as part of your portfolio as you start out your investing journey.