Total internal reflection can take place only if
light goes from optically denser medium to rarer medium
light goes from optically rarer medium (smaller refractive index) to optically denser medium
the refractive indices of the two media are widely different
the refractive indices of the two media are close to different