Then spake Jesus again unto them, saying, I am the light of the world: he that followeth me shall not walk in darkness, but shall have the light of life. (John 8:12)
This dialog recorded in Chapter 8 of John seems to be an extension of the conversation Jesus had with the Pharisees in Chapter 7. It was now the day after the Feast of Tabernacles (John 7:37; 8:2). At the end of Chapter 7, the Jews would have taken Jesus into custody, “but no man laid hands on him” (John 7:44), and the religious leaders were at odds as to what to do with Him (John 7:45-53).
On the following day, John records that the scribes and Pharisees brought to Him a woman caught in the act of adultery asking Jesus to pass judgment on her. Some “scholars” suggest that John 8:1-11, which relates this account, either is not original to John, or if it is original to John, it was not included in the original writing. They come to this conclusion based on variant manuscripts of the Gospel, some of which do not contain the narrative at all, and some that do contain the narrative find it in other locations of the same Gospel. Personally, I will go with the Textus Receptus that places it right where it is in all of our Bibles.
I believe the narrative falls logically into this place. Consider that Jesus debated the Jews on the last day of the Feast of Tabernacles (John 7:37). The conversation ended with their failed attempt to arrest Him (John 7:44). The Jews were then in a dilemma as to what to do with Him (John 7:45-53), and Jesus retreats to His base camp at the Mount of Olives (John 8:1). Then, “early in the morning he came again into the temple, and all the people came unto him; and he sat down, and taught them” (John 8:2). At this time, the Jews brought the woman to Jesus, and Jesus turned the tables on them suggesting that “He that is without sin among you, let him first cast a stone at her” (John 8:7). “Being convicted by their own conscience, went out one by one, beginning at the eldest, even unto the last” (John 8:9). It is worthy to note that, even though Jesus did not condemn the woman, neither did He accommodate her sin. “Jesus said unto her, Neither do I condemn thee: go, and sin no more” (John 8:11, emphasis mine).
Apparently, a crowd, including some Pharisees that were not involved in the “sting operation,” observed what took place and saw how the accusers tucked tail and left. Jesus then addresses the audience that remained. “Then spake Jesus again unto them, saying, I am the light of the world: he that followeth me shall not walk in darkness, but shall have the light of life” (John 8:12, emphasis mine). In spite of what the “scholars” say, the narrative of the woman caught in adultery fits perfectly in this place. The light Jesus brought to bear exposed the hypocrisy of the Jewish religious leaders and sent them into hiding (temporarily). John’s prolog alerts us to the light Jesus brought into the world. “In him was life; and the life was the light of men. And the light shineth in darkness; and the darkness comprehended it not … That was the true Light, which lighteth every man that cometh into the world” (John 1:4-5, 9, emphasis mine). Light dispels darkness and exposes evil. “And this is the condemnation, that light is come into the world, and men loved darkness rather than light, because their deeds were evil. For every one that doeth evil hateth the light, neither cometh to the light, lest his deeds should be reproved. But he that doeth truth cometh to the light, that his deeds may be made manifest, that they are wrought in God” (John 3:19-21, emphasis mine). The Pharisees were in the dark, and the light of Jesus exposed them for what they were.
The dialog between Jesus and the Pharisees continued even though they understood very little of what Jesus had to say. In the conversation, Jesus makes several important points. First, believing in Him is essential to salvation. “If ye believe not that I am he, ye shall die in your sins” (John 8:24); “For the wages of sin is death; but the gift of God is eternal life through Jesus Christ our Lord” (Romans 6:23). Second, if you believe in Him and claim to be His disciple, i.e., follower/student, you must be faithful to His teaching. “Then said Jesus to those Jews which believed on him, If ye continue in my word, then are ye my disciples indeed; And ye shall know the truth, and the truth shall make you free” (John 8:31-32, emphasis mine). His Word is the Bible, and the truth contained in His Word liberates the soul. Jesus is the Living Word (John 1:1), and He gives us His written Word. Therefore, “If the Son therefore shall make you free, ye shall be free indeed” (John 8:36). Third, only those who belong to God can hear and understand God’s Word. “He that is of God heareth God’s words: ye therefore hear them not, because ye are not of God” (John 8:47). The Pharisees did not understand Jesus’ message because, even though they were “religious,” they were not “of God.” Fourth, they who are of God understand His Word and keep it; therefore, they will enjoy eternal life. “Verily, verily, I say unto you, If a man keep my saying, he shall never see death” (John 8:51, emphasis mine).
The fifth point Jesus made revealed His eternal nature and His equality with God the Father. “Your father Abraham rejoiced to see my day: and he saw it, and was glad” (John 8:56). Some scholars believe Jesus was referring to Abraham’s hope in the promise of Messiah, however, that does not seem the fit the Pharisees’ reaction. “Then said the Jews unto him, Thou art not yet fifty years old, and hast thou seen Abraham?” (John 8:57, emphasis mine).
If this mean no more than that he had a prophetic foresight of the gospel-day – the second clause just repeating the first – how could the Jews understand our Lord to mean that He “had seen Abraham?” And if it mean that Abraham was then beholding, in his disembodied spirit, the incarnate Messiah [Stier, Alford, etc.], the words seem very unsuitable to express it. It expresses something past – “he saw My day, and was glad,” that is, surely while he lived. He seems to refer to the familiar intercourse which Abraham had with God, who is once and again in the history called “the Angel of the Lord,” and whom Christ here identifies with Himself. On those occasions, Abraham “saw ME” (Olshausen, though he thinks the reference is to some unrecorded scene). If this be the meaning, all that follows is quite natural. (Emphasis mine)
That is my take on just the normal reading of the text. Jesus referred to His encounters with Abraham recorded in the Book of Beginnings, as the LORD (Genesis 12:7; 15:1-18; 17:1; 18:1), as the Angel of the Lord who stopped him from sacrificing Isaac (Genesis 22:11-18), as Melchizedek (Genesis 14:18-20), and as one of the three “men” that visited with him in the plains of Mamre (Genesis 18). The Pharisees rightly understood that Jesus referred to personal encounters with Abraham; therefore, they questioned, “Thou art not yet fifty years old, and hast thou seen Abraham?” (John 8:57, emphasis mine). Abraham lived 2000 years prior to this time, so how could a mere man, not yet even in his fifties, have a personal encounter with him? Jesus cleared up their confusion. “Jesus said unto them, Verily, verily, I say unto you, Before Abraham was, I am” (John 8:58, emphasis mine). With His authority as God, Jesus identified Himself as the Great I AM. His message was clear and the Pharisees understood precisely what he was saying. “Then took they up stones to cast at him: but Jesus hid himself, and went out of the temple, going through the midst of them, and so passed by” (John 8:59, emphasis mine). For a mere man to make such a claim was blasphemous, and it demanded immediate execution. However, Jesus was no mere man, and His claim was “Verily, verily” (Truly, truly).
As I AM, Jesus is also the Light of the World. Jesus “Who only hath immortality, dwelling in the light which no man can approach unto; whom no man hath seen [i.e., “the light], nor can see: to whom be honour and power everlasting. Amen” (1 Timothy 6:16, emphasis mine). “This then is the message which we have heard of him, and declare unto you, that God is light, and in him is no darkness at all … But if we walk in the light, as he is in the light, we have fellowship one with another, and the blood of Jesus Christ his Son cleanseth us from all sin” (1 John 1:5, 7, emphasis mine). “For God, who commanded the light to shine out of darkness, hath shined in our hearts, to give the light of the knowledge of the glory of God in the face of Jesus Christ” (2 Corinthians 4:6, emphasis mine). “Ye are all the children of light, and the children of the day: we are not of the night, nor of darkness” (1 Thessalonians 5:5, emphasis mine). “And the city [the New Jerusalem] had no need of the sun, neither of the moon, to shine in it: for the glory of God did lighten it, and the Lamb is the light thereof. And the nations of them which are saved shall walk in the light of it: and the kings of the earth do bring their glory and honour into it” (Revelation 21:23-24, emphasis mine).
Jesus said, “I am the light of the world: he that followeth me shall not walk in darkness, but shall have the light of life” (John 8:12, emphasis mine). Reader, have you seen the light, or are you still hiding from the light?
 Jesus’ Seven ‘I AM’ Statements in John (2): https://erniecarrasco.com/2016/09/04/jesus-seven-i-am-statements-in-john-2/
 Robert Jamieson, A. R. Fausset and David Brown, A Commentary on the Old and New Testaments, Commentary on John 8:56.
 Jesus’ Seven ‘I AM’ Statements in John (1): https://erniecarrasco.com/2016/08/28/jesus-seven-i-am-statements-in-john-1/