We must not sink into a sad and disconsolate frame of mind, which would make us faint under our trials; but must endeavor to keep our spirits dilated and enlarged, the better to take in a true sense of our case, and with greater advantage to set ourselves to make the best of it. Philosophy may instruct men to be calm under their troubles; but Christianity teaches them to be joyful, because such exercises proceed from love and not fury in God. In them we are conformable to Christ our head, and they become marks of our adoption. By suffering in the ways of righteousness, we are serving the interests of our Lord’s kingdom among men, and edifying the body of Christ; and our trials will brighten our graces now and our crown at last. Therefore there is reason to count it all joy when trials and difficulties become our lot in the way of our duty.
Like Jesus, did when He went to the cross, He looked at the final outcome. Our trials have a final outcome too, they make us become more like Christ.
Instead of counting our "poor me", we need to focus on what is going on that is positive. We are given a list in Philippians 4:8, on what we need to focus on "Finally, brethren, whatever is true, whatever is honorable, whatever is right, whatever is pure, whatever is lovely, whatever is of good repute, if there is any excellence and if anything worthy of praise, dwell on these things."
When we follow that list during times of trials our joy grows. Why? Because by doing so we are actually focusing on God's love for us. It is His love that brings us joy. So to put it in Bonnie Version, "When we are going through hard times, focus on God's love, and we will have joy."