Graphite and diamond are both made only of carbon atoms, but their structures and bonding are different, so they are used for different jobs.
In graphite each carbon atom forms three strong covalent bonds, giving flat layers of hexagons. Each atom has one outer electron left over. These electrons are delocalised, which means they are free to move along the layers. This is why graphite conducts electricity and is used to make electrodes. The layers are held together only by weak forces, so they slide over each other easily. This makes graphite soft and slippery, so it is used as a lubricant.
In diamond each carbon atom forms four strong covalent bonds to four other carbon atoms in a rigid, three-dimensional giant covalent structure. There are no free electrons, so diamond does not conduct electricity. All the bonds are strong, so diamond is extremely hard. This is why it is used in cutting tools.