Here, Habakuk lists a number of blessings that come to humans through commerce. The planting and harvesting from farming brings food and goods to trade. Husbandry provides animal products and wealth for commerce.
When someone has to go for a colonoscopy, they cannot eat any food for the 36 hours before. The initial reaction is not to exult in the Lord, and rejoice in their salvation. It is to wish they could eat something!
But a colonoscopy, as strange as it sounds, is a great blessing. To be able to have a procedure that lets you know if there is a problem and fix it. Choosing to be blind to a problem that is addressable is poor stewardship. The possibilities of modern technology help to cure us. After removing a couple of polyps, the person is free of them for another season.
The colonoscopy patient experiences this opportunity. To rejoice in being saved from cancer through modern medicine and the good stewardship of decision making. It is not easy when their tummy aches with hunger. But the hunger is a constant reminder of the opportunity. So while it might not be the first choice, the patient embraces it as a good experience, is delivered from future pain, and has the opportunity to struggle to choose a true perspective.
Note that Habakkuk is stating here a determination to choose to rejoice during lean times. He is planning in advance the attitude he intends to choose during the inevitable difficulty. That is an excellent example of preparing for the worst, so we are prepared to receive the best.