An insulator is a material that does not conduct heat or electricity. In comparison, conductors are the materials that conduct electricity and/or heat. Aluminum is a good conductor of heat and electricity. Glass, on the other hand, is an insulator and so is rubber.
To conduct electricity, a material must possess free electrons. For example, metals have free electrons and these "delocalized" electrons conduct the electricity. That is why metals are generally good conductors. In comparison, a material like glass has no free electrons and in the absence of free or delocalized electrons, it is unable to conduct electricity. We can also say that all the electrons are tightly bound around the atoms in the case of glass, leaving no free electrons for conducting electricity.
Glass was commonly used as an insulator in older times. These days rubber is a more commonly used insulator. That is the reason we have rubber coating on electrical wires. It is also suggested to wear shoes and gloves while working with electrical connections.
Hope this helps.