John 21: 20-24Peter turned and saw following them the disciple whom Jesus loved, who had lain close to his breast at the supper and had said, "Lord, who is it that is going to betray you?" 21 When Peter saw him, he said to Jesus, "Lord, what about this man?" 22 Jesus said to him, "If it is my will that he remain until I come, what is that to you? Follow me!" 23 The saying spread abroad among the brethren that this disciple was not to die; yet Jesus did not say to him that he was not to die, but, "If it is my will that he remain until I come, what is that to you?" 24 This is the disciple who is bearing witness to these things, and who has written these things; and we know that his testimony is true.
John is reacting in this verse to the misquoting of Jesus' words that had gained currency in his day. The Lord did not say that John would still be alive at his return. He only said that even if that were the case, why should that affect Peter?
I hope you have found this helpful.