Jesus said this to indicate the kind of death by which Peter would glorify God. Then he said to him, “Follow me!”
References for John 21:19
Peter turned and saw that the disciple whom Jesus loved was following them. (This was the one who had leaned back against Jesus at the supper and had said, “Lord, who is going to betray you?”)
References for John 21:20
When Peter saw him, he asked, “Lord, what about him?”
Jesus answered, “If I want him to remain alive until I return, what is that to you? You must follow me.”
References for John 21:22
Because of this, the rumor spread among the believers that this disciple would not die. But Jesus did not say that he would not die; he only said, “If I want him to remain alive until I return, what is that to you?”
References for John 21:23
This is the disciple who testifies to these things and who wrote them down. We know that his testimony is true.
References for John 21:24
Jesus did many other things as well. If every one of them were written down, I suppose that even the whole world would not have room for the books that would be written.
References for John 21:25