What does John 15:18 mean?
A running theme of Jesus' final teachings to the disciples is reassurance. They are about to see Jesus arrested and crucified (John 18:1–3; 19:18). Afterwards, they will experience the tremendous opposition that plagued the early church (Acts 8:1–3). Bible-believing Christians throughout history have been brutally persecuted. At several points in this discourse, Jesus indicated that He was telling the disciples something in order to prepare them for the future (John 13:9; 14:25, 29). Knowing what is about to happen, and that Christ already expected it, is meant to make those trials easier to endure (1 Peter 4:12–13).Shortly, Jesus will remind the disciples that servants cannot consider themselves "above" the experiences of their master (John 15:20). He first mentioned this when commanding His followers to emulate His example of humble servanthood (John 13:14–16). In this case, Jesus provides a warning: if Christ suffered at the hands of unbelievers, then Christians can't expect to be immune from suffering.
During His earthly ministry, Jesus and the disciples encountered a man who'd been born blind. The disciples echoed the common assumption of their culture: that the man's suffering must be deserved, somehow. Jesus refuted that, stating clearly that the man's blindness wasn't a punishment for sin (John 9:1–3). There is a similar reassurance in this verse: hatred from the world is not always something a Christian has "earned" in some way. The unbelieving world hated Christ—we can expect the world to hate those who follow His example.
That's not to say all struggles experienced by Christians are due to faith. Someone unkind, unfair, or immoral can expect to suffer normal consequences (1 Peter 4:14–15). Nor does it mean only those who experience harsh persecution are real believers—some cultures honor God more than others. But when a person faithfully follows Christ, and non-believers lash out in anger or hatred, that's not the fault of the Christian.