John had presumably gone to speak to somebody else to find out what was going on. There was a fireplace in that open courtyard, and Peter was with a group of servants of the high priest there, warming himself, and then the problems started.
Peter was standing by the fire with the soldiers, trying not to be noticed. That is a dangerous position for the believer to be in. We should always be what we are and not ashamed to be Christians. One shame leads to another.