/u/DisgruntledLemming
The short answer is well, they didn't. The 30YW was not a conflict of thirty years of continuous battles. As the conflict evolved and expanded, belligerents either joined in or increased their involvement in the war. Over time, belligerents were stretched to their breaking points in terms of political will, money, and manpower.
To understand this, consider that the 30YW is usually presented as a serious of histories:
The Bohemian revolt (1618-1621) and Pacification of the Palatine (1620-1625). I've written here and here on the first subject, whereby the Elector Palatine accepted the offer of the Bohemian crown only to become a political liability for the Protestant Union. The Catholic forces defeated the Protestants in the 1620 Battle of White Mountain and by 1623 Frederick V was in exile, remnants of his army fleeing. This led to Imperial occupation of the Palatine in collaboration with the Spanish, who was interested in securing the Spanish Road. This ended the first phase, which was a far more limiting warfare than what was to come.
The second phase called the Danish Interlude started due to Baltic rivalry between Denmark and Sweden. Desperate for help, Frederick V of Palatine asked both Denmark and Sweden for help, two Protestant nations who until recently had been at war. Sweden proposed a limited war to restore Frederick in Palatine, but wanted to lead an alliance himself. This alarmed King Christian of Denmark, who sought to become the leader of Protestants in northern Europe. Despite rebuttal by the Danish Parliment, he personally used his own resources to send troops into Lower Saxony, in which he was also Duke of Holstein. This was the worst possible time to fight a war against the Empire, as the Empire himself had just raised a new army. Unsurprisingly, the Danish were crushed. By 1629, Christian had been defeated even if he could still controlled a few strategic places. On the Imperial side, Emperor Ferdinand II was sufficiently confident to promulgate the Edict of Restitution, intending to roll back secularizations that had happened since the 1555. Importantly, the Emperor dismissed the Imperial commander Wallenstein, leading to disarmament in the HRE.
The third phase Swedish Intervention was finally Gustavus Adolphus' turn in late 1630. The well-drilled Swedish army surprised everybody and won key battles against the Imperials in 1631, forcing the Emperor to recall Wallenstein. But in 1632 the king himself was killed in battle, and Swedish progress gridlocked due to lack of money. Up to this point, France had funded Protestants, and the deadlock forced France to intervene directly. German states had signed the Peace of Prague in 1635, with major concessions such as the revocation of the Edict of Restitution, prohibition of alliances among states against each other, and even further amnesty to rebellious princes such that a united army of the HRE could be found to stop the invasion of France and Sweden. So in a large way, the Peace of Prague effectively put an end to the religious aspect of the 30YW. However, France was unhappy and decided to alter the course of war once again.
That led to the fourth phase Direct French Intervention, with French troops invading in 1635. By 1643, most belligerents had agreed to negotiate for peace in some way -- even if the meetings had to be split between two cities Osnabruck and Munster. It took until 1647-9 for all the points of peace to be agreed upon. To get an idea of how exhausted but desperate they were, consider the 1648 siege of Prague.
So all in all, the 30YW was a complex conflict, but not one in which all belligerents fought continuously. Even on the Imperial side, there were respites as the situation evolved.