The healthcare industry has proven to be particularly resilient to the ebb and tide of market sentiment through the years. While stock performance is individual to each company and its own unique growth story, there's a reason these businesses generally stay the course even when overall macro conditions are suffering.

Broadly speaking, healthcare companies provide products and solutions that people need no matter what is happening with the stock market or the economy at large. That fact can make this space an intriguing place to park cash as you diversify your portfolio and continue on in your investing journey.

If you're looking for top healthcare stocks to buy right now, here are two names you'll want to consider for your basket of buys.

1. Vertex Pharmaceuticals

Vertex Pharmaceuticals (VRTX 0.91%) has been known for its cystic fibrosis drug franchise for some time now. That business has catapulted the company to consistent revenue growth and profitability.

Because Vertex makes the only drugs that are approved to treat the underlying cause of cystic fibrosis, it has been able to control the lion's share of this segment of the rare disease drug market. Its top-selling drug Trikafta covers about 90% of the patient population in the U.S. alone.

Still, management believes there is a significant addressable market opportunity for its cystic fibrosis franchise. Its drugs are helping patients live better and longer, which in turn extends the life cycle for use of its medicines. The company is also working on a new triple-combination therapy for cystic fibrosis, as well as an mRNA-based drug with Moderna for cystic fibrosis patients who can't take its existing lineup of medicines.

Vertex has already set its sights on many other areas of the rare disease drug market. It's in the thick of its early launch phase for Casgevy, a potential one-time functional cure for sickle cell disease and transfusion-dependent beta thalassemia.

The company developed this gene-editing therapy with CRISPR Therapeutics. Management has estimated that the total addressable market opportunity for this product could be upwards of 35,000 people just in the U.S. and Europe.

The U.S. Food and Drug Administration (FDA) just approved Vertex's rolling new drug application submission for suzetrigine, its non-opioid drug candidate for acute pain. Management has placed the total addressable market for this drug at around 80 million people.

The company also just announced its planned acquisition of Alpine Immune Sciences, a biotech company that focuses on developing immunotherapies. Vertex is rapidly expanding its footprint in various untapped sectors of the rare disease drug space. For example, it's also developing drugs to treat the root causes of underserved diseases like APOL1-mediated kidney disease and autosomal dominant polycystic kidney disease (ADPKD) as part of its promising pipeline.

Now looks like a great time to consider this healthcare stock, which could see its growth trajectory sends shares even higher.

2. Johnson & Johnson

Johnson & Johnson (JNJ 0.04%) is one of the household names in the pharmaceutical industry. With a business that has been going strong for about 118 years and counting, and a dividend history that includes 62 consecutive years of payout increases, this is one of those businesses that can be a dependable addition to a long-term investor's portfolio.

The company just raised its quarterly dividend by 4.2%. It boasts a current yield of about 3.3% at the time of this writing. And, to give you an idea of how storied Johnson & Johnson's commitment to its dividend is, this is a stock that has increased its dividend in the ballpark of 80% over the trailing decade alone.

While Johnson & Johnson hasn't matched the S&P 500's total return over the last 10 years, it has delivered solid performance to long-term investors. Over the past decade, the stock has delivered a total return of more than 90%.  Granted, J&J continues to navigate legal issues related to its talc products, but its strong balance sheet is more than able to safeguard the business.

When the company spun off its consumer health division into a separate entity, Kenvue, last year, it not only brought in a cash windfall, but got rid of a business that had been somewhat dampening overall growth. Now, with its pharmaceutical business (known as its innovative medicines segment on financial reports) and medtech businesses remaining front and center, it's focusing on the next era of growth.

The recent quarter saw Johnson & Johnson rake in net sales of $21 billion, up 2% year over year, and profits of $5.4 billion. The company closed the quarter with a whopping $21 billion in cash and investments on its balance sheet, and delivered free cash flow of $3 billion in the three-month period.

It also just announced its latest acquisition, this time of Shockwave Medical. The $13 billion all-cash purchase will boost Johnson & Johnson's presence in the area of cardiovascular intervention. This is a space where the company already has a growing footprint thanks to its previous acquisition of Abiomed (known for the world's smallest heart pump).

With a business at this stage in its growth story, you're not looking for lightning-fast overnight returns or even above-average quarterly growth. You're looking for a wide moat, an impressive portfolio of approved products, a solid pipeline, and a track record of successfully bringing candidates to market.

You'll also want a company that delivers sustained profitability and has a pathway to future growth. Johnson & Johnson definitely meets these benchmarks. It looks like a good time to grow or start a position in this top healthcare stock.