Jesus told Peter that he would deny him three times before the cock crowed twice. 
Instead of Peter asking the Lord to strengthen him, to change his heart, to keep him from that temptation he argued with him. He wouldn’t hear of the “nonsense” that Jesus was speaking. 
He allowed the words of Christ to have zero effect on him. So he did as exactly the Lord said he would: He denied Jesus.
Jesus cautions us when we’re tempted to choose evil. He encourages us to pray for ourselves that we wouldn’t be led into that temptation. He tells us to get into the Word to memorize it so we that won’t sin. 
But so often we ignore His wisdom. 
He loves us in every word He has spoken to us. Every nudge of warning is not only for His kingdom’s benefit but for ours too. 
Choose to make decisions based on Jesus.