We derive great encouragement from this passage:
We are sometimes tempted to think we are not true believers because of the way we deny Christ in our lives and struggle with sin. Yet here we see Christ’s own disciples, who certainly were true believers at this stage, about to deny Him and indeed struggling with sin. So we gain comfort that it is not a single sin or struggle that shows we are not believers but a whole attitude of life in denying Christ and embracing sin that would do so.
We see the magnitude of our indwelling sin and the extent it can reach. We often think more highly of ourselves than we have any right to - and it is at the moments when we think highest of ourselves that we are on the brink of our greatest falls and humiliations. We need to learn we can do nothing without Christ.
We rejoice to see that in spite of their sin, Christ loved His disciples and prayed for them. We know He intercedes in the same way for us and this is a great ground for our assurance of salvation.