Light bends when it crosses into a different transparent medium — that's why a straw looks broken in a glass of water.
Entering a denser medium, the ray slows down and bends towards the normal.
You've probably noticed a pencil dipped in a glass of water looks 'bent' at the surface, or a pool looks shallower than it really is. Both happen because light changes direction when it passes from one transparent medium into another — this is called refraction.
Refraction follows two laws: (i) the incident ray, the refracted ray, and the normal at the point of incidence all lie in the same plane, and (ii) for a given pair of media and colour of light, the ratio sin i / sin r is always a constant. This second law is Snell's Law, and that constant is called the refractive index of the second medium with respect to the first.
Whether light bends toward or away from the normal depends on which direction it's travelling: going from a rarer medium into a denser one (like air into glass), it slows down and bends towards the normal. Going from denser into rarer (glass into air), it speeds up and bends away from the normal.
Key exam points
Watch it explained
Snell's Law of Refraction — Chapter 9, Light Reflection and Refraction, Class 10 NCERT · NCERT Science