CONTEMPLATING the huge deficits in President Reagan's budget, a good many people in Congress seem to have succumbed to hopelessness. If the deficits projected into the future are so large, why casts unpopular votes for spending cuts that can make only minor differences? If the deficits are out of control, why get yourself into trouble by struggling with them? As a response to that kind of pessimism, the Brookings Institution's annual study of the budget is particularly valuable this year.

The Brookings analysis argues that the consequences of letting the deficits run are not tolerable. "Deficits of such a size are unprecedented since the Second World War," Joseph A. Pechman, the editor of the book, writes, "and will cause serious, painful side effects." The analysis provides a reasoned and careful road map toward a solution.

On the central question of defense spending, it takes the position that the Soviet military buildup is a serious challenge to the United States, and requires a serious response. William W. Kaufmann, who contributes a chapter on the military programs, concludes that the country could achieve a stronger defense than the Pentagon currently proposes at somewhat less cost. He asks, for example, whether it is useful to include budget allocations for a protracted nuclear war. He observes that supplying too many highly advanced and unfamiliar weapons to the armed forces too fast may reduce their state of readiness rather than improve it. Mr. Reagan proposes to spend $1,550 billion for defense over the next five years. Mr. Kaufmann suggests that the figure could be safely cut by about $135 billion while actually raising the country's defense capacity beyond the level that the Pentagon's current plans foresee.

With that kind of limited and cautious reduction in defense spending, the budget's structural deficit could be eliminated by a tax increase that rises in steps to bring in about $110 billion a year by 1988. That's a large increase, but by no means unrealistic. It is about double the contingent tax increase to which Mr. Reagan has already given his support.

Eliminating the structural deficit does not necessarily mean balancing the budget. The structural deficit is the hypothetical deficit that the government would run if the economy were running well and the unemployment rate were down to 6 percent. It is now about $155 billion, and, the White House calculates, it will be over $300 billion a year by 1988 if there's no change in the present course. That's a formula for very high interest rates, very high unemployment and industrial decline. Changing that course is not only necessary. It is also possible, the Brookings analysts have demonstrated, and it is possible well within the limits set by the very real requirements of national security.