Diamond and graphite both only have carbons and have covalent bonding involved.Diamond has a giant covalent lattaice and each carbon atom is bonded to 4 other carbon atoms.Graphite on the other hand is formed in layers and each carbon is bonded to 3 other carbon atoms. As a result there will be an extra unbonded electron thus forming a sea of delocalised electrons.
Graphite is soft because it has weak inter molecular forces between its layers.Diamond is hard due to its giant covalent lattice and it has many strong covalent bonds.