Independent presidential candidate John B. Anderson, his campaign sagging and short of cash, shook up his staff yesterday and put media adviser David Garth in full control.

Three top campaign aides, including deputy campaign manager Edward Coyle, resigned as a result of the move.

A fourth aide, campaign manager Michael MacLeod, was relieved of his duties but not his title. He will now take over supervision of the financial side of the campaign.

Garth, in an interview in the campaign's fashionable Georgetown offices, said he had not fired anyone after Anderson asked him to assume the day-to-day direction of the campaign in a meeting late Wednesday night.

The shakeup, he said, should be viewed as part of an effort "not to get John Anderson back to where he was, but forward to where he should be."

The realignments coincide with a general belt-tightening and back-to-basics movement. In recent weeks, some staff members have taken cuts in salaries, expenses have gone unpaid and field offices in each state have been put on a self-supporting basis.

Garth, a highly regarded New York political advertising expert, said one of his first acts was to cancel a whistlestop train tour across Wisconsin, Illinois, Michigan, Indiana, Ohio and Pennsylvania, which campaign aides said would have cost about $225,000. The trip was scheduled to begin Sunday in Anderson's hometown of Rockford, Iii.

In his new role, Garth, who has a reputation for winning longshot campaigns through skilled use of television ads, will carry the title of campaign director, and will spend about 80 percent of his time in Washington.

He has been Anderson's media consultant since the Illinois congressman dropped out of the Republican presidential race and became an independent candidate on April 24.

But the campaign has had little money for television ads during that period because it has to spend about $1.5 million on field operations to get on the ballot in various states. Plans for a $2 million ad campaign between the political conventions were slashed to $400,000 when that was all the money available.

If the $2 million ad campaign had gone forward, Anderson's popularity in the public opinion polls would be 6 percentage points higher than it is today, Garth claimed.

In addition to Coyle, campaign aides resigniing yesterday were treasurer Francis Sheehan and chief scheduler Michael Fernandez. All are veterans of Arizona Rep. Morris Udall's unsuccessful 1976 bid for the Democratic nomination.

Coyle was the engineer behind the scenes in Anderson's highly publicized meeting with Sen. Edward Kennedy before the Democratic National Convention and his selection of former Wisconsin governor Patrick J. Lucey as Vice presidential running mate.

"I think the decision to bring David down was the right one," said Coyle, who attributed his resignation to a feeling that he would no longer be effective with the media adviser in charge. "He will energize the campaign."

"He is the guru, the miracle worker," Coyle added. "John Anderson will be given a second look with him here. any mistakes we may have made will be forgotten. If that happens and Anderson gets in the League of Women Voters debate, the campaign will be off and running."

Fernandez, 30, a Harvard Law School graduate, worked in a number of other campaigns, including the presidential effort of California Gov. Edmund G. Brown Jr. this year.

Sheehan said his resignation was for "personal reasons" and insisted he will continue to work for Anderson in New York, where he lives.

Press secretary Michael Rosenbaum, unpopular with some reporters, will be replaced on Anderson's traveling entourage by Tom Mathews, a veteran who worked for Anderson all year. Mathews said of Anderson:

"I think that he was recovered his original vision, which was to make a statement to the American people about what this country has to face up to, and that making that statement as accurately and forcefully as he can is more important than winning the presidency."

Mathews and Garth described the campaign as in the process of moving from one phase, chiefly concerned with getting on the ballot in each of the 50 states, into a second phase.

"The second phase," Mathews said, "Is John Anderson stating what he believes this country needs to do to recover from the trouble it is in, and he believes it's in deep trouble."

In the process, Anderson has scaled down his financial horizons and now, according to various sources, envisions "a lean and hungry" organization. Originally, the campaign had hoped to raise from $12 million to $15 million. Now elimates are more in the $10-$12 million range, or under. To date, less than $6 million has been raised.

Unlike the nominees of the major political parties, each of whom has received $29.4 million in taxpayers' money. Independent candidates receive no public funds.