“This is my comfort in my affliction, that your promise gives me life.”
The comfort in our affliction is not that God will give us what we want. He does that sometimes, but our hope is not in Him giving us what we think we need. He will always give us what we actually need, which is always for our spiritual good.
For this verse, we need to understand that ultimately, our comfort is in the eternal life that we have in Him. So, in a trial, we definitely pray to God in numerous ways including that He would help mitigate the suffering. However, we also need to understand our own limitations, specifically that we often do not know His will, and that His path for us may be to suffer in order to bring Him glory. And this shouldn’t surprise us. Christ suffered, and said very clearly that those that would follow Him will suffer as well.