The righteous cry out, and the Lord hears them; he delivers them from all their troubles.
A righteous man may have many troubles, but the Lord delivers him from them all.
The Lord redeems his servants; no one will be condemned who takes refuge in him.
Notice that these verses don’t say that He takes their troubles away, but rather, that He delivers them from their troubles. In the days of Noah, God did not remove the flood, but provided an ark for safety to ride out the flood. All who were in the ark were saved. Jesus is our Ark of Safety. Though troubles may be all around us, He provides a refuge in the midst of them.