In John 16 Jesus finished His farewell teaching with honest warnings. His followers would be thrown out of synagogues, and some would be killed by people who believed they were serving God. Jesus said this so they would not stumble. Sorrow filled their hearts. Yet Jesus said, It is to your advantage that I go away, for if I don't go away, the Counselor won't come to you. While on earth Jesus was in one place. The Spirit would be with every believer everywhere.
The Spirit has two ministries here. Toward the world, He convicts of sin, righteousness, and judgment. He shows people their unbelief, the righteousness proved by Jesus' return to the Father, and the defeat of the ruler of this world. Toward believers, the Spirit of truth guides into all truth. He does not speak on His own. He glorifies Jesus by taking what is His and declaring it.
Jesus compared the coming days to childbirth. A woman has sorrow in labor, but when the child is born she forgets the anguish for joy. The cross would bring grief, but the resurrection would bring joy no one could take away. Jesus invited them to pray to the Father in His name, because the Father Himself loves them. Then He spoke plainly: in the world they would have oppression, but they could cheer up, for He has overcome the world. Jesus spoke these words on His way to the cross, yet He spoke of victory.