Diamonds are made of carbon. With enough temperature and pressure, the carbon bonds together and starts growing crystals.
That is pretty neat, but did you know there are diamonds in space?
A white dwarf is a star that has burned up all its fuel. It no longer has any nuclear fusion going on. They are extremely dense and have collapsed to a size similar to Earth.
Since these stars are so dense and have cooled due to the lack of nuclear fusion, astronomers believe the remaining carbon in the stars have probably crystallized. Similar to how diamonds are formed on Earth!
Further Reading: Remarkable White Dwarf Star Possibly Coldest, Dimmest Ever Detected