Yes, it can seem such a contradictory quagmire...
yet, God's grace supersedes and the bottom line becomes clearer with the clarity that only GOD can give, and that is that, in spite of sorrow, hardship, persecution, and excruciating pain, God's TRUTH becomes more "solidly" ingrained in the very fibers of our hearts, souls, and minds, that HE awaits us at the end of a long, dark, and arduous tunnel, and WITH Him aqll of heaven rejoices WITH our God, Who rejoices over us with singing. THIS is what has been planted in the very fibers of our hearts by God Himself, and nothing but nothing can remove it.
This verse comes to mind:
"Nay, in all these things we are more than conquerors through him that loved us. For I am persuaded, that neither death, nor life, nor angels, nor principalities, nor powers, nor things present, nor things to come, Nor height, nor depth, nor any other creature, shall be able to separate us from the love of God, which is in Christ Jesus our Lord." ~Romans 8:37