John’s Gospel is the most self-contained of all the Gospels. The ordeal of Jesus’ passion is presented as embodying the “tribulation” that the whole church must endure to the end, with Judas cast in the role of “the son of destruction” (John 17:12) and the hour in which the Apostles will be “scattered, each to his own home” (John 16:31) being the apostasy that must necessarily precede the Day of the Lord, that is, the resurrection (Peter and his three denials being, perhaps, the embodiment of this episode).
Christian eschatology is nothing if not simple common sense. The Greek term for “falling away” is apostasia, literally, “standing off.” Conversely, “resurrection” in Greek is anastasis, literally, “standing again.” Simple logic dictates that a “standing again” be preceded by a “standing off.” So when Paul says, for instance, in 2 Thessalonians 2, that “the Day of the Lord” (connected again, implicitly, with the resurrection) will not come unless the apostasy comes first, he is merely stating the obvious. It is a scenario as old as Genesis 3, when Adam and Eve fell away by eating the forbidden fruit, had their nakedness (that is, their inner man of lawlessness) revealed, and had to face the judgment of God, being able to “stand again” only after God himself had intervened to provide them an adequate covering for their nakedness. If you want to understand “the end,” then go back to “the beginning” and everything will make sense.
Following his resurrection, Jesus appears to his disciples on the shore of the Sea of Tiberias (John 21). There, he reminds Peter, in particular, of his apostasy (through symbols that recall the night of his denial, such as the breaking of bread and a charcoal fire), reinstates him in love (asking him three times, “Do you love me?”), and then says to him, “Follow me.”
Previously, in a conversation with Peter in chapter 13, Jesus said, “Where I am going you cannot follow me now, but you will follow afterward” (v. 36). The conversation in chapter 21 closes the circle. Jesus, having gone to his death on the cross and having risen in triumph over sin and death, has established the pattern that Peter is now called to follow, even though it may lead him to a place he does not want to go. John states several times throughout his Gospel that Jesus said this or that “to indicate the kind of death he was going to die.” Now, he writes that Jesus said this to Peter “to indicate the kind of death by which he would glorify God.”
Peter, and by implication all who would follow Jesus, must now replicate Jesus’ ministry of redemption and transformation, up to and including making the ultimate sacrifice out of love for him. The path of each individual may not be completely identical. John, for instance, would not die a martyr’s death but would, rather, glorify God through a life of abiding faith that would become an extension of the very life of Christ (“If it is my will that he abide until I come, what is that to you?”). Yet, all who follow Christ are called to hold back nothing, including life itself, from the service of his kingdom.