In the midst of giving the disciples encouragement for the future, he switches gears and gives them a warning that is especially important for us in today's climate. As his followers, we should expect to be hated. But in true Jesus fashion he also tells us how to handle it appropriately.
The book of John tells us that Jesus' disciples gave up everything to follow him, and when he shocked them with his announcement in chapter 13, he then comforted them in his words in chapters 14-17. We can look to these chapters as our instructions from Jesus for the cure for a troubled heart.