Jesus addresses the sorrow they are experiencing at this time because He is leaving. In John 14:1, Jesus tells His disciples not to be troubled. He knew what they would feel, but there would be hope in the future coming of the Holy Spirit. In John 16:22, Jesus tells His disciples that although they are experiencing grief right now, they shall rejoice. He promises that they shall see Him again.
He is returning to the Father who sent Him. Note John 7:33, which states that Jesus told them earlier that He would not be with them much longer. See the following verses: John 12:35 and John 13:36. His disciples have apparently have not been closely listening. Note John 13:33, where Jesus mentions this also. Peter responds to this statement by asking Jesus where He is going. Jesus speaks plainly to him by telling him that where He is going he would not be able to come at that time. Peter will follow Him later. Peter bears this out in 2 Peter 1:14 (NASB) when he says the following: “knowing that the laying aside of my earthly dwelling is imminent, as also our Lord Jesus Christ has made clear to me.”
In the upcoming verses, Jesus tells them about the coming of the Holy Spirit, which will be their Comforter and Counselor.