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."

If you abide in My word

John 8:31-32 NKJV
Then Jesus said to those Jews who believed Him, “If you abide in My word, you are My disciples indeed. [32] And you shall know the truth, and the truth shall make you free.”

1 John 2:3-6 NKJV
Now by this we know that we know Him, if we keep His commandments. [4] He who says, “I know Him,” and does not keep His commandments, is a liar, and the truth is not in him. [5] But whoever keeps His word, truly the love of God is perfected in him. By this we know that we are in Him. [6] He who says he abides in Him ought himself also to walk just as He walked.