"The day of trouble" was a specific time of judgment that God would bring upon the wicked.
Isa. 22:5,
" For it is a day of trouble, and of treading down, and of perplexity by the Lord God of hosts in the valley of vision, breaking down the walls, and of crying to the mountains." (KJV)
Psa. 50:2-3,
"2 Out of Zion, the perfection of beauty, God hath shined. 3 Our God shall come, and shall not keep silence: a fire shall devour before him, and it shall be very tempestuous round about him." (KJV)
This was judgment language. Compare it to "a day of the Lord" in Isa. 2:12, 13:6, 9; 34:8; Jer. 46:10; Lam. 2:22; Ezek. 13:5, and others. As such, we have to determine from each passage which people the prophet was calling / warning to know which ones were under judgment.
Psa. 50:7,
"Hear, O my people, and I will speak; O Israel, and I will testify against thee: I am God, even thy God." (KJV)
In Psa. 50, the wicked were the children of Israel who were going through the motions, making the sacrifices as they had been commanded, but were elevating the outward symbols of the sacrifices over the inward spiritual need for those sacrifices. The animals were a substitute for them and for their sins, and forgetting that, they were not offering their hearts and minds to God.
In Psa. 50:9-13 God told them that He has no need of these animal sacrifices; that if He were hungry He could kill his own for meat; that everything already belongs to Him. The Israelites were treating the sacrifices as if God had need of them, and had forgotten the true reason / meaning for them.
He was warning them of a coming day of judgment for their sins and wickedness. But, He always offers relief from His judgment for the repentant.
Jer. 16:19,
" O Lord, my strength, and my fortress, and my refuge in the day of affliction, ..." (KJV)
All of this Psalm was recalling them to their sins, and was forward looking to the gospel of Christ.
Mark 12:33,
"And to love him with all the heart, and with all the understanding, and with all the soul, and with all the strength, and to love his neighbour as himself, is more than all whole burnt offerings and sacrifices." (KJV)
Habbakkuk was warning Israel of the invasion of the Chaldeans (Babylonians). The translation in the ESV does not agree with the KJV, nor the Interlinear.
" When I heard, my belly trembled; my lips quivered at the voice: rottenness entered into my bones, and I trembled in myself, that I might rest in the day of trouble: when he cometh up unto the people, he will invade them with his troops." (KJV)
The "he" was the king of Babylon (Nebuchadnezzar) and "the people" were Israel.
Excerpt from Matthew Poole's commentary on Hab. 3:16:
"When he cometh up; the king of Babylon, with all his bitter and cruel nations, bent on violence and rapine.
Unto the people; against the Jews, my people, saith the prophet.
He will invade them with mighty force, and cut in pieces, make most bloody work among them.
With his troops; with numerous armies, and spoil in troops, where what one leaves another will take; where none escape the fury of some or other in the troops:... " Source: here
So, again the day of trouble, the day of judgment was directed against Israel.
Prov. 16:4 is generally applied to the wicked of any generation who refuse to repent. They will meet their day of judgment.
Ellicott's commentary on this verse:
"The Lord hath made all things for himself—i.e., to serve His own purposes, that His wisdom, goodness, &c, may be thereby revealed. Or the passage may be translated, “hath made all for its own end or purpose.” The assertion that “He has made the wicked for the day of evil,” does not mean that He created any one for punishment—i.e., predestined him for destruction. It only teaches that even the wicked are subservient to God’s eternal purposes; that Pharaoh, for instance, by his rebellion could not change God’s plans for the deliverance of His people, but only gave Him an occasion for showing forth His power, justice, goodness, and longsuffering. The “day of evil,” i.e., punishment, at last overtook Pharaoh in accordance with the law and purpose of God that the wicked, if unrepentant, shall be punished, and thereby serve as a warning to others; but God by his longsuffering shewed that He was “not willing” that he should “perish,” but rather that he “should come to repentance” (2Peter 3:9). This appears to be also the teaching of St. Paul in Romans 9:17, sqq." Source: here
"The day of trouble" was synonymous with "a day of the Lord" and "the day of affliction" as well as "the day of wrath". They all meant a time of God's judgment upon the wicked.