Jesus tells the disciples they are going to be hated, and that He is about to go away and what it all means: John 15:18–17:26
It was only hours before He was to be arrested, and Jesus did His best to warn his disciples about what was coming but without giving away the gory details.
They didn’t understand, so He described their soon-to-be grief, which would turn to joy, and what the longer-term benefits would be:
John 16:22-24 So you have sorrow now, but I will see you again; then you will rejoice, and no one can rob you of that joy. At that time you won’t need to ask me for anything. I tell you the truth, you will ask the Father directly, and he will grant your request because you use my name. You haven’t done this before. Ask, using my name, and you will receive, and you will have abundant joy.