Total internal reflection can take place only if

TIR happens when the angle of incidence is greater than the critical angle. Critical angle case happens only when moving from lighter medium to denser.

1