Even as an amature gardener I know this basic rule: it's easiest to pull weeds after the rain. That same stuff that made the day grey and crummy is also the stuff that loosed the soil for purging.
Before going any further, let me state that God does not look down from Heaven and actively look for ways to cause us pain for the fun of it. He most certainly leverages pain, though. Quite profoundly.
See, God understands the "garden" of our souls. He made every one of them. He knows we don't always hear Him in the sun because we don't feel a need for Him. But when storms come and pain sets in then we start talking. We complain, we threaten, we beg, we ask, we bargain, and hopefully, just hopefully, we listen. During deep pain things in our souls get all turned upsidedown — they're loose. And God in His infinite wisdom, knows this is a wonderful time to do some rearranging and will give us ample opportunity to participate. (However, in the end we choose our response. We can either shut God out or become more surrendered to His activity.)
Are you in a storm? Are you in pain? Then you have a profound opportunity to rearrange the things in your soul. You can choose truth over lies, and choose dependence on God rather than the myriad of temporary escapes.
Of course I don't mean to be trite. Storms are no fun. Pain hurts. Deep pain hurts deeply. I don't know one human who navigates pain perfectly (including me). But pain brings one to a prime state for weeding, to make more loose soil for beautiful things to grow.