John 8:12: Then Jesus spoke to them again, saying, "I AM the light of the world. He who follows Me shall not walk in darkness, but have the light of life."
Jesus is at the Jewish Feast of Tabernacles! One of the great symbols of that Feast was Light! At the end of the feast, when the lights are extinguished, Jesus said that he was the light of the world! Throughout the Old Testament, light is an important symbol. There is the pillar of fire and cloud leading the nation of Israel on their journey (Exodus 13). In Psalm 27v1, the Psalmist describes God as "my light".
The nation of Israel was to be God's light to all the world (Isaiah 49v6) so that God would be the world's light (Isaiah 60v19-22). So by referring to Himself as the light of the world, Jesus is saying it is He who shines light into peoples spiritual eyes and gives them understanding which in turn leads to them seeing their need of God and His ability to satisfy their spiritual needs.