Diamond and graphite are made of the same atoms, but their properties are totally different! How does this work?
Both diamond and graphite have giant structures made of pure carbon, but they have different patterns of bonds between the carbon atoms.
Diamonds are incredibly hard; they are one of the hardest materials known to humanity. The reason diamonds are good jewels is that they are so hard. This means that they don't get scratched, so they stay shiny.
The structure of diamond is a giant covalent structure. Every carbon atom is linked to four other carbon atoms by covalent bonds. All the bonds in the diamond structure are covalent, so every single bond is very strong - there are no weak links in the structure. This also means that the melting temperature of diamond is extremely high - about 3350 °C. There are no free electrons or ions, so diamond cannot conduct electricity.
Graphite is also made of carbon, but the arrangement of the atoms is very different.
This picture shows the graphite structure. There are hexagonal rings of carbon atoms, which link together to make sheets. The bonds in the sheets are covalent, so each sheet is very strong. The bonds holding the layers together are much weaker. This means that the layers can slide over each other easily. When you write with a pencil, the "lead" in the middle is actually graphite. As you write, flakes of graphite are broken off the pencil lead, and stick to the paper.
The other important difference between diamond and graphite is that graphite conducts electricity, unlike diamond. Each carbon atom in graphite makes three covalent bonds in the layer. That means there is a spare, delocalised bond which sits between the layers. These can move, which allows graphite to conduct electricity.
Even though diamond and graphite are both made of carbon atoms, the way the atoms are joined together is really important in explaining why diamond and graphite behave in the ways that they do.