Once again, I defer to the introduction of Habakkuk found in the English Standard Version of the scripture. It offers an incredibly helpful overview of this text.
Habakkuk was probably written about 640–615 b.c., just before the fall of Assyria and the rise of Babylon. God used Assyria to punish Israel (722); now he would use Babylon to punish Judah. This prophecy would be fulfilled several decades after Habakkuk, in 586. The “theme question” of Habakkuk is, how can God use a wicked nation such as Babylon for his divine purpose? God judges all nations, said Habakkuk, and even Babylon would eventually be judged (Babylon fell to Persia in 539). But God’s people are held to a higher standard because they have greater revelation. Though God’s ways are sometimes mysterious, “the righteous shall live by his faith” (2:4) while awaiting salvation. These words are quoted three times in the New Testament (Rom. 1:17; Gal. 3:11; Heb. 10:38).