From Aquinas' commentary on St John:
The effect of this light is to expel darkness; and so he says, Whoever follows me will not walk in darkness. Because this light is universal, it universally expels all darkness.
Now there are three kinds of darkness.
1) There is the darkness of ignorance: "The have neither known nor understood; they walk in darkness" (Ps 81:5); and this is the darkness reason has of itself, insofar as it is darkened of itself.
2) There is the darkness of sin: "You were at one time darkness, but now you are light in the Lord" (Eph 5:8). This darkness belongs to human reason not of itself, but from the affections which, by being badly disposed by passion or habit, seek something as good that is not really good.
3) Further, there is the darkness of eternal damnation: "Cast the unprofitable servant into the exterior darkness" (Mt 25:30). The first two kinds of darkness are found in this life; but the third is at the end of life.
Thus, Whoever follows me will not walk in darkness: the darkness of ignorance, because I am the truth; nor the darkness of sin, because I am the way; nor the darkness of eternal damnation, because I am the life.