The people cried out to the Lord, and He said: “I led you; I delivered you; I gave you the land of those who oppressed you . . . But you have not obeyed my voice” (from Judges 6:7-10).
Still, God delivered them. Read the whole story in Judges 6-7.
When you pray, remember to obey.