He who saw it has borne witness—his testimony is true, and he knows that he is telling the truth—that you also may believe.
John, the beloved disciple, the last of the gospel writers to pen his account of walking with Jesus, wants his readers to know that he was there, near the cross, when Jesus died. His account is eyewitness. He knows what he saw and he recorded it in his gospel accurately. John also knew the meaning behind what he saw, going of his way to point out the details in which Jesus' death fulfilled Old Testament scriptures.
In four details that John shared, Jesus' death was a fulfillment of scripture. 1) The soldiers divided and cast lots for His clothing in fulfillment of Psalm 22:18. 2) He was given sour wine in fulfillment of Psalm 69:21. 3) They did not break His legs in keeping with the custom for the Passover Lamb's sacrifice (Exodus 12:46). 4) Jesus was pierced through the side with a spear in fulfillment of Zechariah 12:10.
The combination of scriptural fulfillment and personal eyewitness testimony bear powerful witness to the saving work of Christ's cross. The eyewitness details give credibility to the historicity of the actual event as it really occurred. The scriptural fulfillment points to the sovereign, saving work of Jesus on the cross as God foreordained it to be. A real event, in real time, in conjunction with what the scriptures told brought about our salvation!
So what did John want from readers when he told us these things? John's goal was the faith of those who heard them. He wants us to believe. His goal in writing the gospel was that saving faith might come to whose who read and heard this account. He had borne true witness, tied that witness in details to the scripture, so that we might be convinced that Jesus is Lord and Savior and believe upon Him, trusting Jesus' atonement for the salvation of our souls and deliverance from our sins.