John Piper answers...
The Gospel of John is a portrait of Jesus Christ and his saving work. It focuses on the last three years of Jesus’ life—and especially on his death and resurrection. It’s purpose is clear in John 20:30-31: “Now Jesus did many other signs in the presence of the disciples, which are not written in this book; but these are written so that you may believe that Jesus is the Christ, the Son of God, and that by believing you may have life in his name.” The book is written to help people believe on Christ and have eternal life.
But don’t get it in your head that the book is therefore only for unbelievers. Believers on Jesus must go on believing in Jesus in order to be saved in the end. Jesus said in John 15:6, “If anyone does not abide in me he is thrown away like a branch and withers; and the branches are gathered, thrown into the fire, and burned.” And in John 8:31, he said, “If you abide in my word, you are truly my disciples.”So when John says, “These are written so that you may believe that Jesus is the Christ, the Son of God, and that by believing you may have life in his name,” he meant that he was writing to awaken faith in unbelievers and sustain faith in believers—and in that way lead both to eternal life. And there may be no better book in the Bible to help you keep on trusting and treasuring Christ above all."
John Piper, "In The Beginning Was The Word"