The refractive index of a material, which is a measure of how much light slows down when passing through that material, is directly related to the material's density. Generally, denser materials have a higher refractive index, meaning that light travels slower through them.
For instance, the refractive index of water is approximately 1.33, while the refractive index of glass is around 1.5. This indicates that light travels slower in glass than in water due to the higher density of glass. Similarly, the refractive index of diamond, which is one of the densest naturally occurring materials, is about 2.42, resulting in a significant slowdown of light within the diamond.
In summary, the higher the density of a material, the stronger the interaction between light and the material's particles, leading to a decrease in the speed of light and a higher refractive index.