"Then they prayed to Yahweh to help them in their trouble"
"their difficulties" or "their afflictions"