From: John 16:5-11
The Action of the Holy Spirit (Continuation)
(Jesus said to His disciples,)  "But now I am going to Him who sent Me; yet none of you asks Me, `Where are You going?'  But because I have said these things to you, sorrow has filled your hearts.  Nevertheless I tell you the truth: it is to your advantage that I go away, for if I do not go away, the Counselor will not come to you; but if I go, I will send Him to you.  And when He comes, He will convince 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 the Father, and you will see Me no more;  of judgment, because the ruler of this world is judged."
6-7. The thought that He is going to leave them saddens the Apostles, and our Lord consoles them with the promise of the Paraclete, the Consoler. Later (verses 20ff), He assures them that their sadness will turn into joy which no one can take away from them.
Jesus speaks about the Holy Spirit three times during the discourse of the Last Supper. The first time (14:15ff), He says that another Paraclete (advocate, consoler) will come, sent by the Father, to be with them forever; secondly, He says (14:26) that He Himself will send them, on behalf of the Father, the Spirit of truth who will teach them everything; and now He unfolds for them the complete plan of salvation and announces that the Holy Spirit will be sent once He ascends into Heaven.
8-12. The word "world" here means all those who have not believed in Christ and have rejected Him. These the Holy Spirit will accuse of sin because of their unbelief. He will accuse them of unrighteousness because He will show that Jesus was the Just One who was never guilty of sin (cf. John 8:46; Hebrews 4:15) and therefore is in glory beside His Father. And, finally, He will indict them by demonstrating that the devil, the prince of the world, has been overthrown through the death of Christ, which rescues man from the power of the Evil One and gives him grace to avoid the snares he lays.
Source: "The Navarre Bible: Text and Commentaries". Biblical text taken from the Revised Standard Version and New Vulgate. Commentaries made by members of the Faculty of Theology of the University of Navarre, Spain. Published by Four Courts Press, Kill Lane, Blackrock, Co. Dublin, Ireland. Reprinted with permission from Four Courts Press and Scepter Publishers, the U.S. publisher.