Refraction occurs when light moves from one medium to another and there is a difference in densities of the two mediums.
An example is light going from air into water when you shine a light into the water.
To understand what happens, picture a bowl filled with water and a post is standing straight up in the bowl of water. The post is perpendicular to the surface of the water. This post is called a "normal" line, meaning a line perpendicular to the surface.
Now take a laser and shine it at the surface of the water at any angle. As the laser strikes the surface of the water the speed slows down and the beam of light bends downward toward the bottom of the bowl instead of continuing straight ahead. You can observe this if you put a pencil at an angle in a beaker of water. Look at the pencil from various angles and you can see it looks like the pencil has bent.
In general, if light goes from a less dense medium (such as air) to a more dense medium (such as water or a diamond) it slows down and bends toward the normal. If light goes from a more dense medium to a less dense medium, it speeds up and bends away from the normal line.