The man who saw it has given testimony, and his testimony is true. He knows that he tells the truth, and he testifies so that you also may believe.
This incident made a lasting impression on the mind of the writer, who is undoubtedly the beloved disciple, John. The writer does not identify himself and yet John is the last disciple mentioned (19:26-27) and is the only disciple known to be present at the crucifixion.
John 19:26-27 When Jesus saw his mother there, and the disciple whom he loved standing near by, he said to his mother, “Dear woman, here is your son,” and to the disciple, “Here is your mother.” From that time on, this disciple took her into his home.
His testimony about the incident is utterly reliable. Plummer notes that “S. John first says that his evidence is adequate; then he adds that the contents of it are true. Testimony may be sufficient (e.g. of a competent eyewitness) but false: or it may be insufficient (e.g. of a half-witted child) but true. S. John declares that his testimony is both sufficient and true.”
The witness says that he writes these things so that faith may be produced in his readers, which is the main purpose of his writing this gospel (John 20:31). It is to be noted that the manner of Christ’s death does indeed inspire faith (Mark 15:39).
John 20:31 But these are written that you may believe that Jesus is the Christ, the Son of God, and that by believing you may have life in his name.
Mark 15:39 And when the centurion, who stood there in front of Jesus, heard his cry and saw how he died, he said, “Surely this man was the Son of God!”