Peter, James, and John witnessed the transfiguration of Jesus Christ. They saw His appearance change into something glorious, and they also saw Moses and Elijah, and the three disciples heard the voice of God announce the divine Sonship of Jesus. How hard would it have been to keep silent about such an event? Yet, Jesus told them to keep silent until after His resurrection,
Now as they came down from the mountain, He commanded them that they should tell no one the things they had seen, till the Son of Man had risen from the dead. So they kept this word to themselves, questioning what the rising from the dead meant (Mark 9.9–10).
They had to keep such a magnificent event in confidence, but with self-discipline anyone can accomplish such a feat. However, they did note that Jesus indicated the time would happen when they could announce it; when He rose from the dead. They did not know what that meant, assuming, I suppose, that it must have been some kind of hidden message. Yet, they found out later that Jesus had spoken plainly and when He did rise from the dead, they announced what they had witnessed, and that is why we have it in our Bibles.