When light hits a boundary it can be reflected. The law of reflection says the angle of incidence equals the angle of reflection. Both angles are measured from the normal, an imaginary line at 90° to the surface.
Light is refracted when it crosses a boundary between two materials and changes direction. This happens because its speed changes. When light enters a denser medium such as glass from air, it slows down and bends towards the normal. When it leaves the glass, it speeds up and bends away from the normal.
Now take light inside glass heading for the boundary with air. As the angle of incidence increases, the refracted ray bends further from the normal. At the critical angle the refracted ray travels along the boundary, so the angle of refraction is 90°. For glass the critical angle is about 42°.
If the angle of incidence is greater than the critical angle, no light leaves. All of it is reflected back into the glass. This is total internal reflection. It only happens when light travels from a denser medium towards a less dense one. Optical fibres use it: the light hits the wall of the fibre at an angle greater than the critical angle and stays inside the fibre.