What does John 21:22 mean?
This comes immediately after Jesus has restored Peter after a painful fall (John 13:36–38; 21:17). The prophecy about Peter's death, in a way, also serves as a prediction that Peter's faith will never fail. John, James, and Peter were Jesus' closest followers (Matthew 17:1; Mark 14:33; Luke 8:51). Jesus has just predicted the nature of Peter's death, with John standing nearby (John 21:18–20). Out of natural curiosity, Peter has asked about John's fate (John 21:21).Jesus' response is not harsh, but it is direct. He gives no prediction, but only points out that what happens to John has nothing to do with Peter's faith. Peter doesn't need to know what will happen to John—now that he's been restored, he just needs to obey: "you follow me!" Even if John were to live from that moment until Jesus' second coming, it would not change Peter's calling or his need to obey Christ in faith.
That principle applies, more broadly, to Christians even today. It's good to care about the fate of others. We should seek to meet their needs. But whether others "win" or "lose," and even whether they live or die, doesn't change our obligation to focus on personal obedience.
Ironically, even though Jesus is refusing to comment on John's death, rumors and misinterpretation will arise. In the very next verse, John repeats the precise words used. He does this to counter an incorrect assumption that he would not die until Jesus returned (John 21:23).