But he turned and said to Peter, “Get behind me, Satan! You are a hindrance to me. For you are not setting your mind on the things of God, but on the things of man.”” (Matthew 16:23, ESV)

This incident [in which Peter rebukes Jesus for speaking about his upcoming suffering and death] takes place only a few short verses after it is this same Peter who has announced that Jesus is ‘the Christ, the Son of the Living God!”

Through the Bible Day by Day Devotional Commentary says here:

How soon Peter fell from his high estate! Beware! The voice that bids us spare ourselves is Satan’s. Self-pleasing ends in destruction. Self-denial and self-sacrifice are the divine path to life. Let us be more eager to lose ourselves than to find ourselves; more set on the cross than on the glory; more eager to promote the well-being of others than our own. We do not choose or make our cross; Christ gives each a little bit of his true Cross to bear as he pleases.

Peter did not think [nor did he understand] that Jesus should suffer and be killed, Jesus understood that his sacrifice was everything and that the cross came before the resurrection.