When the Apostle John was in prison on the island of Patmos, God showed John His future plans which were addressed to the 7 churches.
God’s plan included the return of Jesus! God also showed John how Jesus looked in detail. This made John very scared and fearful of Jesus. He saw the holiness of Jesus and how Jesus is judge. John knows how serious sin is and that Jesus will judge sinners. At the same time, Jesus comforts him and those who have faith in Him.
John recorded this and everything else God showed him about His future plans in the book of Revelation.