By his own understanding of what he had witnessed and experienced, Peter boasted that he was so committed and devoted to Jesus that he would die for him. Jesus assured Peter that he would actually deny Him three times before the rooster crowed.
Peter learned that he did not have the ability to follow through with such a claim. He did not have the presence of or intimacy with the Father, Son, and the Holy Spirit. "But the Counselor, the Holy Spirit, whom the Father will send in my name, will teach you all things and will remind you of everything I have said to you." (John 14:26)
If the deity of any of these three is insufficient, then truth has diminished and religion takes up that slack. Peter could not give up his life for Jesus until the Holy Spirit had been sent to live in him. Then would the Son be able to rise in his heart and enable him to follow through with all the Spirit has called him to, rather than a romantic idea in his own heart, and this to the ultimate glory of the Father.
"And we have something more sure, the prophetic word, to which you will do well to pay attention as to a lamp shining in a dark place, until the day dawns and the morning star rises in your hearts, knowing this first of all, that no prophecy of Scripture comes from someone’s own interpretation. For no prophecy was ever produced by the will of man, but men spoke from God as they were carried along by the Holy Spirit." (2 Peter 1:19-21)
Until the fullness of the Trinity has been firmly established in our heart, Jesus will be denied when troubles come.
"For in Him all the fullness of Deity dwells in bodily form, and in Him you have been made complete..." (Col. 2:9,10)
"Dear friends, if our hearts do not condemn us, we have confidence before God and receive from him anything we ask, because we obey his commands and do what pleases him. And this is his command: to believe in the name of his Son, Jesus Christ, and to love one another as he commanded us. Those who obey his commands live in him, and he in them. And this is how we know that he lives in us: We know it by the Spirit he gave us." (1 John 3:21-24)