If you're looking for a safe place to invest in for next year, consider buying shares of solid dividend stocks.

Some even have a track record of paying dividends for at least 25 straight years. To achieve that, a business needs to have strong financials and enjoy recurring, persistent demand for its products and services. These are the types of businesses that can offer investors stability in what could be a volatile year in 2023.

3M (MMM -0.23%) and Cardinal Health (CAH 0.44%) are two attractive dividend stocks that also provide high yields of 2.5% per year and better. If you've got $5,000 that you can afford to invest, then that could result in at least $125 in dividend income next year.

1. 3M

3M is a storied conglomerate that makes products for a host of different industrial segments, including healthcare, construction, and transportation. With that kind of diversification, it's little wonder the company has a robust business and can continuously make increases to its dividend for decades.

This year, however, its shares have fallen more than 30% as many investors may be seeing it as too much of a pandemic stock, with its masks and respirators being less in demand than they were during the early stages of the pandemic.

But 3M's business has been relatively stable this year, with net sales for the period ended Sept. 30 totaling $8.6 billion and declining just 3.6% year over year. And over the trailing 12 months, the company has generated free cash flow totaling $3.9 billion, which is 14% higher than the amount of cash dividends it paid out during that time ($3.4 billion). 

3M does have some risk in the near term as it is facing numerous lawsuits related to defective earplugs. However, it may not be a significant concern for investors in the long run as earlier this year the involved subsidiary, Aearo Technologies, filed for Chapter 11 and bankruptcy proceedings are underway.

The company has an impressive track record of paying its shareholders a dividend for 100 years without interruption. 3M's current quarterly dividend of $1.49 is 27% higher than the $1.175 the company was paying its shareholders five years ago, averaging a compound annual growth rate (CAGR) of 4.9% during that time. With its significant drop in price this year, 3M's dividend yield is also up to an incredible 4.9%, which is nearly 3 times the S&P 500 average of 1.7%.

For long-term investors, this could be an ideal buy-and-forget investment.

2. Cardinal Health

Cardinal Health's business isn't nearly as diversified as 3M's; its operations center around distributing medical and pharmaceutical products. However, it can provide investors with a great way to gain exposure to the healthcare industry. Cardinal Health works with 90% of U.S. hospitals and says it helps healthcare products reach 3.4 million patients.

Unlike 3M, Cardinal Health has been a hot stock to buy this year, soaring more than 50% in value.

In February, Cardinal Health along with other healthcare companies reached an agreement to settle opioid-related litigation; Cardinal will need to pay $6 billion over a period of 18 years for its role in the opioid crisis. While it's a hefty bill, the company has a lot of time to pay it and in the meantime, it gives investors a bit more clarity as to Cardinal's future. The agreement covers 90% of eligible local governments, with 46 states signing on to it, effectively putting the matter to rest.

Meanwhile, the business has been delivering some solid results of late. For the period ending Sept. 30, Cardinal's revenue totaled $49.6 billion and rose 13% year over year. And the company's adjusted per-share earnings of $1.20 incurred a modest decline of 7% from the prior-year period, which isn't bad given the current inflationary environment.

And the dividend remains incredibly safe. The company has generated free cash flow totaling $3.4 billion over the trailing 12 months, which is more than 6 times the dividend Cardinal has paid out during that time frame. The company has increased its payouts for 36 straight years and its current quarterly dividend of $0.4957 has risen a modest 7% from the $0.4624 that Cardinal was paying investors five years ago. That averages out to a CAGR of 1.4%.

Today, the stock yields around 2.5% and can be a great investment to buy and hold for the long term.