Investing always carries a bit of risk, but you can bring that risk down to an absolute minimum by taking one specific move: and that's selecting a core group of solid companies to hold onto for the long term. These players should have a track record of earnings growth, an impressive market position, and prospects that ensure earnings strength well into the future.

In many cases, these companies will be familiar names, selling products you use every day. But you also may discover new-to-you players in fields -- such as biotech -- that you may not connect with on a daily basis. You can buy these stocks with confidence, knowing that over time, the companies have proven themselves -- and may continue winning. Here are five you can confidently invest $500 in right now.

Two investors smile while studying something on a computer.

Image source: Getty Images.

1. Amazon

Amazon (AMZN 3.43%) is the leader in two markets growing in the double-digits: e-commerce and cloud computing. They've helped the company grow earnings into the billions of dollars and become a household name worldwide.

This growth is far from over. Amazon recently improved its cost structure, which should pay off over time. The company's moves in e-commerce include making its fulfillment process more efficient, and in cloud computing include major investments in artificial intelligence (AI).

So, e-commerce customers receive packages more quickly, and cloud customers can launch generative AI projects on Amazon Web Services' platforms. All of this should keep customers coming back, and help Amazon stay in the lead.

It's also encouraging to see that, after a difficult time last year, Amazon's earnings have recovered, with the company reporting gains in revenue, net income, free cash flow and more in the most recent quarter.

2. Apple

When you think of Apple (AAPL -0.35%) you probably think of the iPhone or the Apple Watch. Those and other products contribute significantly to revenue, and thanks to Apple's moat, or competitive advantage, this should continue. Apple has built such a strong brand that fans stick with it, regardless of the products' price tags.

But there's even more good news: Apple also has created a billion-dollar services business, generating recurrent revenue thanks to all of the people out there using Apple devices. Services are many, from digital content to data storage, and in the recent quarter, services revenue reached a record high.

Finally, one last bit of good news: Apple's services are highly profitable for the company, with a gross margin of more than 70% in the quarter, compared with a margin of 36% for products. So, this business may be Apple's next big revenue driver.

Two women drink soda while sitting on a small boat.

Image source: Getty Images.

3. Coca-Cola

You'll love Coca-Cola (KO) for two reasons: its brand strength that powers steady earnings gains and its dividend growth.

Let's talk earnings first. Thanks to well-known products like its eponymous beverage and others like Dasani water and Minute Maid juices, customers keep coming back even during difficult economic times such as today. Revenue has continued to rise in recent quarters, even through price increases, and Coca-Cola has gained more and more market share.

As for the dividend, the company has increased it for more than 50 years, putting Coca-Cola on the list of Dividend Kings. This shows dividend growth is important to the drinks giant, so it's likely to continue with this policy -- and that means you can expect more and more passive income as the years go by.

4. Vertex Pharmaceuticals

Vertex Pharmaceuticals (VRTX -0.06%) is the global leader in cystic fibrosis (CF) treatment, and that has brought the company billions of dollars in earnings over the past several years. The biotech has the products, patents, and pipeline to keep that position until at least the late 2030s.

On top of that, Vertex is expanding into other treatment areas and even recently scored a regulatory win -- the U.K. delivered the first ever authorization for a treatment using CRISPR gene editing techniques when it gave the nod to Vertex's candidate for blood disorders. The company now awaits decisions in the U.S. Vertex also considers its candidate for the very common problem of pain as a near-term launch opportunity -- that candidate is involved in phase 3 trials.

So, thanks to ongoing dominance in CF and successful new programs, Vertex's growth story should continue over the long term.

5. Johnson & Johnson

Johnson & Johnson (JNJ -0.46%) recently made a very interesting move: It spun off its consumer health business, the unit that made J&J a household name, into a separate entity. But this actually was a wise thing to do since consumer health had been a drag on growth -- and now J&J plans to devote its resources to its higher-growth businesses of pharmaceuticals and medtech.

Pharma and medtech adjusted operational sales climbed more than 8% (excluding the coronavirus vaccine) and 6%, respectively, in the most recent quarter. And more than 70% of J&J's sales generally come from a No. 1 or 2 market share position. The company's vast portfolio of products as well as its deep pipeline should keep the growth going.

Finally, you'll also want to get in on J&J for its dividend payments. Like Coca-Cola, it's a Dividend King, meaning it's a top stock you can count on for passive income growth over time.