"But now I go away to Him who sent Me, and none of you asks Me, 'Where are You going?' But because I have said these things to you, sorrow has filled your heart. Nevertheless I tell you the truth. It is to your advantage that I go away; for if I do not go away, the Helper will not come to you; but if I depart, I will send Him to you. And when He has come, He will convict the world of sin, and of righteousness, and of judgment: of sin, because they do not believe in Me; of righteousness, because I go to My Father and you see Me no more; of judgment, because the ruler of this world is judged. I still have many things to say to you, but you cannot bear them now. However, when He, the Spirit of truth, has come, He will guide you into all truth; for He will not speak on His own authority, but whatever He hears He will speak; and He will tell you things to come. He will glorify Me, for He will take of what is Mine and declare it to you. All things that the Father has are Mine. Therefore I said that He will take of Mine and declare it to you" (John 16:5-15).
The apostles had asked Jesus previously where He was going (cf. John 13:36; 14:5). However, they never asked such out of concern for Him but from their own selfish interests. They wanted to know what Jesus' departure meant to them. Their sorrow was caused by selfishness. But, had the apostles been viewing the situation from Jesus' perspective, they would have been rejoicing (cf. 14:28).
Like the apostles, it is easy for anyone to slip into a selfish, gloomy disposition. Such will happen when one allows his perspective to focus on short-term physical disappointments and not long-term spiritual blessings and successes.
"Nevertheless I tell you the truth. It is to your advantage that I go away" - Even from a selfish standpoint, Jesus' departure would bring reasons to rejoice, though they were currently overlooking such. His intent here is to tell them "the truth"; that is, He will explain why He must depart. This knowledge would help them overcome their grief. His departure was expedient because otherwise the Holy Spirit would not be sent, but there were other significant reasons. If Jesus did not depart, then: (1) The gospel could not be preached in its fullness (since such included the death, burial, and resurrection of Christ; cf. I Cor. 15:1-4), (2) Forgiveness of sins would not be possible (cf. Heb. 9:23-26), and (3) The worldwide mission of the church could not begin (cf. Matt. 28:19,20).
"And when He has come, He will convict the world of sin, and of righteousness, and of judgment" - The Greek word here translated as "convict" means to convince with evidence (which would include instruction, refutation, and persuasion). These three points are elaborated upon in the following verses. First, the Holy Spirit would convict the world of sin, specifically the sin of rejecting the Christ (i.e., disbelief). He would do this by using the apostles as His mouthpieces (e.g., Acts 2:4,22-24). Second, the Holy Spirit would convince the world of the righteousness of Christ (cf. Heb. 4:15) and the need for righteous living (cf. Acts 10:34,35), even though Jesus wouldn't be with them much longer in the flesh. Third, the Holy Spirit would convince the world of judgment that would ultimately be rendered via Jesus (cf. Acts 17:31). All need to realize that siding with "the ruler of this world" (i.e., Satan) will not lead to victory on that final day. He stands condemned before God. Peter's sermon in Acts 2 reproved the ones who rejected Jesus Christ (sin), proved His resurrection (righteousness), and showed their guilt (judgment). These three topics are fundamental New Testament doctrines.
There was much more that could be said and needed to be said, but the time was not right. They were not prepared to receive deeper instruction at that moment, but they would be ready in about two months. At that moment, Jesus' apostles are little children in their understanding, and He treats them appropriately as such. Mature Christians would do well to remember that babes in Christ do not yet possess seasoned judgment or comprehensive knowledge of God's will. Thus, they must be treated with extra patience and tolerance, as the Lord did for His disciples.
"However, when He, the Spirit of truth, has come, He will guide you into all the truth" - The Holy Spirit would guide the apostles into all the truth, not just some of it. Thus, there was no unknown truth left for Joseph Smith, Mary Baker Eddy, or any other modern-day "prophet" to reveal (cf. Jude 3; Gal. 1:6-9; Rev. 22:18,19).
"He will not speak on His own authority" - That is, His responsibility was the work of revelation, not origination. The same thought is found in John 16:14 when Jesus stated that the Spirit would take of what was His (i.e., Jesus' teachings) and declare it to them.
"All things that the Father has are Mine" - Because He and His Father are one in nature (cf. 10:30), that which belongs to the Father also belongs to Him. This truth is an indirect affirmation of Jesus' deity.