Psalm 99:8 summarizes a significant Old Testament pattern.
The LORD answers those
That call upon Him
He forgives them
Yet corrects their sin
The LORD does answer when His people call out to Him. Those who cry or call out to him need to see themselves as totally dependent on Him: unable to fix this problem without Him. Sometimes it is sin that has caused their desperate situation. Their cry to the LORD is their repentance. Their repentance brings them forgiveness. To help them avoid that sin in future the LORD may avenge or correct them. He may have used their desperate situation as that correction. Or He may take them through yet another difficult experience to help them learn obedience.