A bear market officially got underway this month as the S&P 500 continued to fall in value. Down by 23% since January, the index has been under consistent pressure this year as multiple factors (inflation, interest rate increases, the war in Ukraine) have been making investors nervous about the future of the economy. 

Although the near term looks challenging for many businesses, there are some great stocks to buy and hold for the long term. Both drugmaker AstraZeneca (AZN -0.34%) and tech giant Apple (AAPL -0.53%) are in good shape to weather the current conditions and generate strong results for investors from here on out.

1. AstraZeneca

AstraZeneca is a top oncology company, and that can make it a relatively resilient business to invest in today. Cancer care is ongoing and doesn't stop for a recession or inflation.

In its first-quarter results, for the period ending March 31, oncology sales rose 21% year over year to $3.6 billion. As good as that looks, there's more growth on the way. The company has a potential blockbuster cancer drug in Enhertu, which has been effective in treating breast cancer for patients with both high and low levels of HER2, a key protein. Analysts project the drug's peak revenue could top $6.6 billion.

The company's other major segments -- cardiovascular, renal, and metabolism -- generated $2.2 billion in sales and rose by 14% in Q1. With more than 180 projects in its pipeline spanning multiple therapeutic areas, there's no shortage of opportunities for the business to build on the strong results it is generating today.

In addition to its solid growth prospects, the stock also pays a dividend yield of 2.4%. That's higher than the S&P 500 average of 1.4% and can help bolster your overall returns. Shares of the company are also trading at a reasonable 15 times future earnings, which is in line with the average healthcare stock in the Health Care Select Sector SPDR Fund

AstraZeneca's modest valuation can lessen the risk of a steep decline in a bear market. And thus far, a sell-off hasn't been happening. With year-to-date gains of around 5%, the stock has been one of the better investments to be holding this year.

2. Apple

Another solid growth stock to buy and hold is Apple. A favorite of Warren Buffett, the company was once referred to by the billionaire investor as "probably the best business I know in the world."

It's a hard statement to argue with given that despite its high-priced products, which often retail for more than $1,000, the company continues to generate growth. That strong brand loyalty could make Apple one of the better-performing growth stocks to own, even during a recession. In the second quarter of fiscal 2022, Apple's revenue topped $97.3 billion for the period ended March 26 and rose 9% year over year.

Although its dividend yield is fairly modest at just 0.7%, the company rewards investors through its buybacks and the share appreciation they will likely profit from in the long term. Over the trailing 12 months, Apple has reported free cash flow of $105.8 billion. And of that total, it spent $85.8 billion on share repurchases plus $14.7 billion on dividend payments.

Shares of Apple are down 26% this year, but that's likely due to the broad correction that's happening in the markets right now as opposed to anything the business is doing wrong. Apple's cash-rich operations make it one of the safer tech stocks to own today, and buying it on the dip could be a great move for long-term investors.