One of my favorite Primary songs begins with the line "I like to look for rainbows whenever there is rain." The song goes on to be about baptism and repentance, but I'd like to take that same line and apply it to finding blessings amid afflictions.
There are at least two lessons we can learn from this line of lyrics. The first centers around the word "look." We have to look for rainbows. They're not always easy to see. In fact, they are sometimes easy to miss. The same is true for blessings. When adversity comes, it can sometimes be difficult to see the blessings amid them, so we really have to look for them.
The second lesson is that, like rainbows, some blessings don't appear until after the storm passes. Sometimes, we can't find the blessings in our afflictions, even when we look for them, because they don't exist yet. God has an eternal perspective, and while He has promised that everything will work out for those who follow Him, that doesn't mean that everything is going to work out right away. Sometimes, God uses an affliction to set up blessings to come some time in the future. At those times, we need to be faithful and endure the storm in order to receive the blessings that will come after it.
God loves His children, and He would much rather bless us than curse us, but, of necessity, some of the blessings He gives us seem like curses at first, like when He gives us challenges in order to bless us with strength. Knowing God's true intentions can help us endure our afflictions, knowing that blessings will eventually come of them. I feel confident in saying that God will eventually bless us in compensation for every undeserved affliction He puts us through. In the meantime, we need to stay faithful and keep watching and waiting for the blessings He offers us through the trials He asks us to endure.