Carbon has four available binding sites and depending on how one atom binds to other atoms, it can form different structures. If you look up the structure of diamond and graphite, you’ll see that they are all made out of carbon but they are arranged differently.