And in this I rejoice, yes, and will rejoice. For I know that this [imprisonment] will turn out for my deliverance through your prayer and the supply of the Spirit of Jesus Christ.

Philippians 1:18-19

Growing up in school, we learn that 1+1=2. But does it always? If one cloud merges with another, how many clouds are there? Not two, but one. Sometimes, from a different perspective, we see new things.
Nobody enjoys going through difficult times. (Take Job in the Old Testament as an example.) But if we step back and look at our situation from a different perspective, we might see it differently. That’s what Paul did when he was imprisoned in Rome. In spite of his difficulties, he found reasons to rejoice. And what were his reasons? That with the Holy Spirit’s help, he would be delivered from his chains.
He didn’t know when or how, but he trusted that God was at work to bring good things out of bad and cause him to become more like Christ (Romans 8:28-29).
In times of trouble, ask God to broaden your perspective, to give you spiritual eyes to see the new growth that can result in your life. There is a certain kind of maturity that can be attained only through the discipline
of suffering.
D.A. Carson