Following Jesus' arrest, we read in Matthew 26:58, "But Peter followed him at a distance, right up to the courtyard of the high priest. He entered and sat down with the guards to see the outcome." John's gospel provides additional detail: "Simon Peter and another disciple were following Jesus. Because this disciple was known to the high priest, he went with Jesus into the high priest's courtyard, but Peter had to wait outside at the door. The other disciple, who was known to the high priest, came back, spoke to the servant girl on duty there and brought Peter in" (John 18:15-16).
We don't know what happened to the other disciple (presumably John). Sensing the tension in the air, this other disciple may have quietly slipped away. However, Peter stayed and soon found himself surrounded by temple police, just a room away from where Jesus was on trial.
What elements led to Peter's downfall, i.e. his denial of his Lord? I suggest five downward steps. First, it began with proud self-confidence. He told Jesus, "Even if all fall away on account of you, I never will" (Matt.26:33). Second, there was insubordination, telling Jesus that He was wrong: "Even if I have to die with you, I will never disown you" (v.35). Third, there was prayerlessness in the garden: "Then [Jesus] returned to his disciples and found them sleeping" (v.40). Fourth, there was Peter's independent spirit: "Then Simon Peter, who had a sword, drew it and struck the high priest's servant, cutting off his right ear" (John18:10). Fifth, there was compromise: "Then [Peter] began to call down curses, and he swore to them, 'I don't know the man!'" (Matt. 26:74).
Peter's attitude and action provides us with a warning. In the words of the Apostle Paul, "So, if you think you are standing firm, be careful that you don't fall!" (I Cor. 10:12).