Passage
And this is the judgment, that light is come into the world, and men have loved darkness rather than light; for their works were evil. For every one that does evil hates the light, and does not come to the light that his works may not be shewn as they are; but he that practises the truth comes to the light, that his works may be manifested that they have been wrought in God.
Nearby Context
John 3:17 For God has not sent his Son into the world that he may judge the world, but that the world may be saved through him.
John 3:18 He that believes on him is not judged: but he that believes not has been already judged, because he has not believed on the name of the only-begotten Son of God.
John 3:19 And this is the judgment, that light is come into the world, and men have loved darkness rather than light; for their works were evil.
John 3:20 For every one that does evil hates the light, and does not come to the light that his works may not be shewn as they are;
John 3:21 but he that practises the truth comes to the light, that his works may be manifested that they have been wrought in God.
John 3:22 After these things came Jesus and his disciples into the land of Judaea; and there he abode with them and baptised.
John 3:23 And John also was baptising in Aenon, near Salim, because there was a great deal of water there; and they came to [him] and were baptised:
Study Lenses
The verse centers on "world", "light", "darkness", "judgment", "come", "loved", "rather", and "than". It is saying that the contrast between light and darkness marks a real divide in how people respond to God's work.
The nearby context moves from verse 18's "He that believes on him is not..." into verse 22's "After these things came Jesus and his...", so "world" and "light" belong inside that flow. In Jesus Explains God's Saving Love, the local focus is new birth, eternal life, belief and unbelief, and God's saving love.
A plain takeaway is to answer the verse's own emphasis on "world" and "light" with trust shaped by these words, not by a vague optimism outside the passage.