"I am the light of the world. Whoever follows me ..." (John 8:12)

"I am the light of the world. Whoever follows me will never walk in darkness, but will have the light of life." (John 8:12)

What does Jesus mean by 'light'?

The word "light" - translated from the Greek word φῶς (phōs) - refers to illumination, and when used in a metaphorical sense, "of truth and its knowledge" according to the lexicon.

Quite simply, a light is an illumination bright enough to see with. A light in the darkness gives the ability to see. A light offers someone who is stumbling in the darkness the opportunity to see where they are going.

"Light" is thus being used metaphorically by Jesus.

Jesus is using the word "light" to refer to himself as being able to illuminate the Truth. Through his teachings, Jesus can guide anyone who hears them back to God. Imagine if we were in the woods at dark with no light. If we found someone with a flashlight we would certainly follow them because their flashlight allows us to see where we are going.

What is the 'light of life'?

Jesus follows this statement by saying that, "Whoever follows me will never walk in darkness, but will have the light of life."

What does Jesus mean by "Whoever follows me"? The word "follow" in the text is translated from the Greek word, ἀκολουθέω (akoloutheō), which means, according to the Greek lexicon, " to follow one who precedes, join him as his attendant, accompany him."

This is consistent with the English word "follow." According to the Merriam-Webster dictionary, “follow” means:
1. to go, proceed or come after
2. to engage in as a calling or way of life
3. a) to be or act in accordance with; b) to accept as authority

We can, therefore, apply Jesus’ statement. To follow Jesus is to accept his authority and act in accordance with his teachings. To follow Jesus is to engage in Jesus' teachings as a calling or way of life. To follow Jesus is to engage in the instructions of Jesus. And what were those instructions? Jesus confirms his most important instruction:
“ ‘Love the Lord your God with all your heart and with all your soul and with all your mind.' This is the first and greatest commandment.” (Matt. 22:37-40)
A person in the darkness of ignorance does not realize that loving and serving God brings the ultimate happiness. A person in ignorance lives a life directed by a constant search for fulfillment through the senses. A person in ignorance moves from one thing to another, thinking that the next thing or the next person will fulfill them. This person is constantly empty because they do not know what will ultimately fulfill them. So they keep searching, in ignorance that loving God will fulfill them.

What is 'darkness' in this context?

A person in darkness will not know who they are. Thus they search for their identity, asking "who am I?"?

When someone follows Jesus, they first learn from him through his teachings. They learn about their identity as spiritual rather than the physical body:
"Do not be afraid of those who kill the body but cannot kill the soul." (Matt. 10:28)
"The spirit is willing, but the flesh is weak.” (Matt. 26:41)
"The Spirit gives life; the flesh counts for nothing. The words I have spoken to you—they are full of the Spirit and life." (John 6:63)
A follower of Jesus will learn that the Supreme Being is also spirit:
"Flesh gives birth to flesh, but the Spirit gives birth to spirit." (John 3:6)
"God is spirit, and His worshipers must worship in the Spirit and in truth." (John 4:24)
Jesus also teaches his follower to connect with the Supreme Being who lies on another plane of existence and sees from within:
"But when you pray, go into your room, close the door and pray to your Father, who is unseen. Then your Father, who sees what is done in secret, will reward you." (Matt. 6:6)

What is the goal of life according to Jesus?

Jesus also taught that the goal of life was to do the will of the Supreme Being - which means to serve Him and please Him out of love:
“Not everyone who says to me, ‘Lord, Lord,’ will enter the kingdom of heaven, but only the one who does the will of my Father who is in heaven." (Matt. 7:21)
Yes, doing the will of the Supreme Being doesn't mean being forced to serve Him, as a slave might be forced to serve a master. Nor does it mean to serve God in order to receive something back, as one might engage in a business relationship.

Rather, Jesus was teaching voluntary service - service that is performed out of love:
“ ‘Love the Lord your God with all your heart and with all your soul and with all your mind.' This is the first and greatest commandment.” (Matt. 22:37-40)
Jesus not only taught these things. He also showed by his example how to execute this devotional relationship with the Supreme Being. Consider this prayer to God:
Going a little farther, he [Jesus] fell with his face to the ground and prayed, "My Father, if it is possible, may this cup be taken from me. Yet not as I will, but as You will." (Matthew 26:39)
This indicates that Jesus did not want to do his own will, but he wanted to do God’s will because he loved God and wanted to serve God.

This service attitude, wanting to please God out of love, is the core principle of Jesus’ life and teachings. Jesus' teachings were about executing a loving service relationship with the Supreme Being: Seeking to please the Supreme Being with one's life. 

Jesus didn't just ask this of his followers - He also stated this about his own relationship with the Supreme Being:
"By myself I can do nothing; I judge only as I hear, and my judgment is just, for I seek not to please myself but Him who sent me." (John 5:30)