Total internal reflection can take place only if light is travelling from a denser medium to a less dense medium, such as from glass to air or from water to air.
When light travels from a denser medium to a less dense medium, the speed of light decreases and the angle of refraction increases. As the angle of incidence increases, there is a critical angle beyond which the refracted angle becomes 90 degrees and the light is completely reflected back into the denser medium. This phenomenon is called total internal reflection.
Total internal reflection has many practical applications, such as in optical fibers, where light is reflected internally along the length of the fiber to transmit information, and in prism-based optical instruments like binoculars and cameras, where it is used to bend light and create an image.