27 Peter also, though full of faith and devotion, yet because, not yet conscious of our common weakness, he had presumptuously said to the Lord, “I will lay down my life for Your sake,” fell into the trial of his presumption before the cock crowed thrice. Although, indeed, that trial was a lesson for our salvation, that we might learn not to think little of the weakness of the flesh, lest through thus thinking little of it we should be tempted. If Peter was tempted, who can presume? Who can maintain that he cannot be tempted? And without doubt for our sakes was Peter tempted, so that, the proving of the temptation did not take place in a stronger than he, but that in him we should learn how, resisting in temptations, although tried even by care for our lives, we might yet overcome the sting of the temptation with tears of patience.
Source: On the Death of Satyrus (New Advent)