A carbon star is a star with more carbon than oxygen in its stellar atmosphere. Carbon and oxygen in a star's atmosphere forms carbon monoxide, and if carbon is left over, other carbon compounds are formed, giving the star a red appearance. Most stars (e.g., the Sun) have more oxygen than carbon in their atmospheres.
One way they are formed is thought to be asymptotic giant branch stars with helium that have produced carbon through helium fusion. Another way is accretion in a binary.
Carbon stars can emit carbon in their stellar wind, leading to carbon in cosmic dust.