We can forgive investors for being skittish. General Motors (GM -0.05%) used to be one of the safest, most respected, most reliable stocks for a retirement portfolio there was. The company's record of dividend payments was enviable, and helped retirees sleep well at night.

Image source: General Motors.

Then the Great Recession hit, and the company went under. Shareholders lost everything.

But this is a new company, with new leadership, and a new -- albeit young -- record of dividend payments. With the current yield hovering at 4.2% and the stock trading for under six times earnings, it's worth asking: How safe are General Motors stock and its dividend?

The most important thing for dividend investors

When it comes to investing in companies for their dividends, there's nothing more important than free cash flow (FCF). Unlike earnings, which can be massaged and distorted with accounting gimmicks, free cash flow is a more direct measure of how much money a company puts in its pocket every year. And it is from free cash flow that dividends are actually paid.

In General Motors' case, the task is a bit more complicated. The company was obligated to pay out dividends to preferred shareholders once it had enough cash on hand following the Great Recession. However, that practice is no longer necessary. The following chart shows how much was paid in dividends to common shareholders over the past few years.

GM's dividends and free cash flow. Data sources: SEC filings, Yahoo! Finance. TTM = trailing 12 months.

There are two big takeaways from this chart. The first is that General Motors continues to improve its FCF, which is a very good sign. Some investors are worried that we're entering the top of a cycle and that FCF could soon dip -- more on that below. But the bottom line is that the trends are healthy.

The second takeaway is that the dividend appears to be very safe. At no time has the company used more than two-thirds of FCF to pay the dividend, and over the past year, only 42% of FCF has been used on the payout. That means that the dividend is sustainable, and has room for growth.

As far as dividend health goes, GM's gets an A+.

But what about the stock and the underlying company?

This is where things start to get a little messy. Car-buying is a phenomenon that tends to run in cycles: Consumers buy a car and use it for a long time. They tend to wait until the time is right -- generally a combination of a healthy economy and signs that their own car is starting to wear down -- before making another purchase.

While it might make sense to assume that these cycles are different for everyone, that's not always the case. Because we're all affected on some level by the state of global finance, our car-buying habits tend to happen within relatively similar intervals.

As such, many investors are worried that the global car-buying spree, which began following our slow emergence from the Great Recession, will soon be hitting the brakes. Indeed, inventories have been growing at dealerships -- especially of Chevrolets.

The company is already preparing for the plateau. It will be idling plants in Michigan and Kansas for one to three weeks this month. And it announced layoffs of 2,000 workers at the end of 2016, with 1,300 more to follow in March. While this isn't happy news, fellow Fool Daniel Miller points out that these are the types of financial restraints that the company has to take: "It's decisions like these that will eventually prove to Wall Street that Detroit automakers have come an astonishingly long way in the last decade."

If you're thinking about buying shares of the stock and want a single metric to see whether GM is showing the requisite restraint to be investment-worthy, watch "days' supply of new vehicles," which allows you to see if inventory is building up too fast. By the end of 2016 this metric had fallen to 71, from 87 in November -- a very healthy move. The ideal is to steadily approach 60 days' supply.

GM may not continue to enjoy the heady days of profit growth that it has in recent years, but that doesn't mean the stock is doomed. Now is the time for management to prove that it has learned from mistakes of the past, and can not only survive, but thrive even when demand dampens.