After six days Jesus took Peter, James, and John his brother, and led them up a high mountain by themselves. And he was transfigured before them; his face shone like the sun and his clothes became white as light. And behold, Moses and Elijah appeared to them, conversing with him. Then Peter said to Jesus in reply, “Lord, it is good that we are here. If you wish, I will make three tents here, one for you, one for Moses, and one for Elijah.” While he was still speaking, behold, a bright cloud cast a shadow over them, then from the cloud came a voice that said, “This is my beloved Son, with whom I am well pleased; listen to him.” When the disciples heard this, they fell prostrate and were very much afraid. But Jesus came and touched them, saying, “Rise, and do not be afraid. ”And when the disciples raised their eyes, they saw no one else but Jesus alone. As they were coming down from the mountain, Jesus charged them, “Do not tell the vision to anyone until the Son of Man has been raised from the dead.” (Mt 17:1-9).
The account of the transfiguration follows Peter's confession at Caesarea and the first announcement of Jesus’s passion (cf. 16:13ff). This is the "ultimate" reason why it is always worth having the courage to confess Jesus as Lord and God, even in the most difficult and trying moments, because Jesus is Lord. The transfiguration, a foretaste of the resurrection, is offered as a horizon that aims to alleviate fear and instill courage in the face of the journey of life.
A few verses earlier, in Mt 16:22, Peter, as well as the other disciples, rebel against the fact that Jesus announced his "passion and death". They could not accept to follow a Messiah whose human existence would end that way. It is in view of this premise that the experience of the transfiguration must be understood. Jesus had spoken of His death on a cross (cf. Mt 16:21ff), and the conditions for following Him: "If anyone wishes to come after me, let him take up his cross..." (Mt 16:24). Now Jesus wants to help His disciples understand that, while it is true that He would suffer and die, it is also true that He would rise again. The transfiguration is a "live" anticipation of the resurrection to prepare the disciples to face what would happen in between, that is His passion and death.