CHEYENNE, WYO., JULY 20 -- Abruptly shifting his focus from attempts to convince the Soviet Union that the United States and its allies pose no military threat, President Bush visited the home of the nation's MX missile force today to emphasize the need for a strong defense.

"We must maintain an effective deterrent, especially in the face of continuing across-the-board modernization of Soviet strategic forces," Bush said.

As the United States reduces defense spending, he added, "We must have an orderly build-down, not some kind of a fire sale."

As Bush inspected an underground MX missile and control room, White House press secretary Marlin Fitzwater said, "People have to remember their missiles are aimed at us. Even though our relationship with the Soviet Union is changing, people need to be reminded they can't let down their guard."

The tour of Francis E. Warren Air Force Base MX operations near here came on a day that began with a political speech in which Bush attacked Democrats in Congress for producing government "gridlock" while also praising them for joining in budget negotiations.

"We're facing government by gridlock in Washington, with spending skyrocketing out of control, good legislation thrown aside for pork barrel programs and a budget deficit looming over our children's children," Bush told a GOP breakfast in Billings, Mont.

Reading off an indictment of the Democratic Congress on issues from overspending to overregulation, Bush said, "Americans are fed up . . . they hear about the president trying to hold the line on spending and the Congress spending money it doesn't have. And I think now, given the magnitude of this problem, enough is enough."

But in the next breath, Bush said the administration is trying to do "something meaningful" about the deficit and that "we are getting some good cooperation with the leadership on the Democratic sides of the aisle."

The speech illustrated the president's difficulty in this election cycle in trying to run against the same Democratic Congress the White House is depending on to produce a budget agreement and bipartisan accords on a range of other measures.

In his speech, Bush also tried to address another Republican problem: How to draw a distinction between the two parties when the GOP's two main issues -- anti-communism and opposition to tax increases -- are rapidly declining in importance. "Some people think there's no difference between the two parties," Bush said. "I've come here to tell you . . . there is."

Bush defined the GOP as the party of "opportunity, growth, choice in child care and education and the creativity of the marketplace and a government that understands it works for you and not the other way around."

On "the far side," he said, are Democrats, the party of "red tape and bureaucracy, still pushing for higher and higher spending, still telling the states how to conduct their affairs and still pushing for mandated benefits . . . ."

Here in Wyoming, Bush suddenly decided to add the missile base tour to his schedule, cutting into time that had been reserved for a fishing break. Fitzwater said Bush felt he should visit the base for the morale of the troops and because of the defense budget negotiations in Congress.

The president is battling with Congress over the MX, as he is several aspects of the defense budget.

Bush asked for $2.8 billion in the fiscal 1991 budget to take 12 of the MX missiles out of their silos and put them on a mobile rail system as part of his strategic modernization program.