All four gospels (Matthew 26:34-35, Mark 14:29-31, Luke 22:33-34, John 13:36-38) relate the prediction by Jesus at the Last Supper that Peter would deny Him three times before the rooster crows the next morning.
In Matthew "34 Jesus said unto him, Verily I say unto thee, That this night, before the cock crow, thou shalt deny me thrice.
35 Peter said unto him, Though I should die with thee, yet will I not deny thee. Likewise also said all the disciples.
The gospels then interweave the denials through His trial at the Sanhedrin.
1. Following His arrest
Peter's first denial to a servant girl
Luke 22:54-57 Then they seized him and led him away, bringing him into the high priest's house. Peter followed at a distance and when they had kindled a fire in the middle of the courtyard and had sat down together, Peter sat down with them. A servant girl saw him seated there in the firelight. She looked closely at him and said, "This man was with him." But he denied it. "Woman, I don't know him," he said.
Also John 18:17
2. Later to the same servant girl.
Mark 14:69-70 When the servant girl saw him there, she said again to those standing around, "This fellow is one of them." Again he denied it. [6]
Also John 18:25
3. The third denial to a group of people
Matthew 26:73-75 After a little while, those standing there went up to Peter and said, "Surely you are one of them, for your accent gives you away." Then he began to call down curses on himself and he swore to them, "I don't know the man!" Immediately a rooster crowed. Then Peter remembered the word Jesus had spoken: "Before the crows, you will disown me three times." And he went outside and wept bitterly.
Jesus is looking at Peter after his denial, in Luke 22:59-62.
59 And about the space of one hour after another confidently affirmed, saying, Of a truth this fellow also was with him: for he is a Galilaean.
60 And Peter said, Man, I know not what thou sayest. And immediately, while he yet spake, the cock crew.
61 And the Lord turned, and looked upon Peter. And Peter remembered the word of the Lord, how he had said unto him, Before the cock crow, thou shalt deny me thrice.
62 And Peter went out, and wept bitterly.
In John 18:26-27, Peter is challenged by a relative of the man wose ear Peter had cut off during the arrest of Jesus in the Garden of Gethsemane .
26 One of the servants of the high priest, being his kinsman whose ear Peter cut off, saith, Did not I see thee in the garden with him?
27 Peter then denied again: and immediately the cock crew.
Also Luke 22:59-62, John 18:26-27