And we know that in all things God works for the good of those who love Him, who have been called according to His purpose.
Now I want you to know, brothers, that what has happened to me has really served to advance the gospel.
2 Corinthians 1:4
...who comforts us in all our troubles, so that we can comfort those in any trouble with the comfort we ourselves have received from God.
Many times I have wondered why we have to go through troubling times and others have told me that we should count everything as a blessing. That's hard to do when you hurt, but turning to God for comfort makes dealing with the hurt so much easier. After the hurt is over we find that it's even easier to share our experience with those that are going through something similar.
I once read a story about a doctor who had to have a major surgery. Being a surgeon himself, he knew what the technical aspects of the surgery would be like. It wasn't until after the surgery he gained insight into what an actual patient experiences. That one surgery has made him a better surgeon. Our life experiences, good and bad, make us better equipped to share with others, offer them encouragement and fulfils God's purpose for our lives.