Hi! So yes, most glass and sand are both made from the same material SiO2 (or quartz) the main difference between glass and sand is something called crystallisation. Sand is crystalline which means it has an ordered structure which repeats itself in space, this ordered structure is what gives sand it’s colour as the electrons in a material with an ordered structure behave differently to the electrons in a material where the structure has no order. The material where the structure has no order is known as amorphous-SiO2 and this is what glass is made of, the behaviour of electrons in this amorphous material is what makes it clear/transparent.
Let me know if you want me to make that more clear for you!