Habakkuk lived during the seventh century before Christ. It was a time of deep apostasy for Judah. People were openly breaking God’s law; the righteous were being oppressed; and the poor and defenseless were being tyrannized. Many were worshipping idols.
It was a dark day and Habakkuk didn't like what he saw. Not only was Judah filled with sin; God didn't seem to be doing anything about it. And that troubled Habakkuk. He wondered, “Why isn't God punishing the evildoers and setting things right?”
The Lord's answer was that He'd take care of things in His own good time. Meanwhile, the righteous would live by faith. (See Habakkuk 2:4.)
The book ends with a lovely prayer by Habakkuk. It's well worth reading, especially in moments of doubt or discouragement. The prayer ends on this note:
“Even though the fig trees have no fruit ... even though the sheep all die and the cattle stalls are empty, I will still be joyful and glad, because the Lord God is my Savior” (Habakkuk 3:17, 18, TEV).