Answer:
The index of refraction of the first medium must be higher than the index of refraction of the second medium
Step-by-step explanation:
Snell's law describes the behaviour of light at the boundary between two mediums:

where
n1 and n2 are the index of refraction of the two mediums
are the angle between the direction of the light ray and the normal to the interface
We can rewrite the condition as:

Let's assume now that the light is travelling in the first medium with a very large angle with respect to the normal to the surface, i.e.
, so that
. In this case, we have

We notice that if
, the ratio on the right is larger than 1, and so the term
should be also larger than 1: but this is not possible of course, since the sine function is always less than 1. Therefore, in this case total internal reflection occurs, because no refracted ray is produced.