Two different minerals are formed from the element carbon. One is graphite which is one of the softest minerals on Earth. The other is diamond which is the hardest substance on Earth (10 on Mohs' hardness scale). The difference in hardness is due to the way the carbon atoms attach to one another. In diamond, they attach in a three-dimensional manner that mineralogists describe as a framework.
Diamond forms at extremely high temperatures and pressures, conditions that are only possible very deep in the Earth’s crust or even the upper mantle. Large diamonds, particularly large diamonds without flaws, are extremely rare. These flawless diamonds are very valuable as gemstones. The vast majority of diamonds are small, flawed and colored by dark impurities. These impure diamonds are used in industrial uses.