He said it first in The Cosmic Connection (1973): "All of the rocky and metallic material we stand on, the iron in our blood, the calcium in our teeth, the carbon in our genes were produced billions of years ago in the interior of a red giant star. We are made of star-stuff."
The line most of us know is the 1980 one, from Cosmos: "The nitrogen in our DNA, the calcium in our teeth, the iron in our blood, the carbon in our apple pies were made in the interiors of collapsing stars. We are made of star stuff."
He said it many times, and he was not being metaphorical. He meant it literally — that essentially every atom heavier than helium in your body was forged in a star or in its death, and scattered across the galaxy.
We are not like stars. We are not inspired by stars. We are made of them — their ash, their legacy, their long slow gift to whatever came next.