The federal government, in its most serious warning in recent years about the nation's eating habits, urged Americans yesterday to eat less of many of America's most popular foods.

The departments of Agriculature and Health, Education and Welfare said Americans should eat less fat, especially less saturated or solidified fat, and less cholesterol, sugar and salt -- as well as less food altogether -- if they want to avoid premature death from several diseases.

In effect and sometimes explicityly, the recommendations warn Americans away from too much red and fatty beef, too many cholesterol-laden eggs, to much fat-rich whole milk and butter, too many salty prepared meats and snacks and too much sugared food, like sweet breakfast cereals.

The recommendations are only that, "not a prescription," and they are "purely advisory" and will not force anyone to do anything, Agriculture Secretary Bob Bergland emphasized.

But he and other officials also said the recommendations, have already led Agriculture's school lunch and other food programs to buy less fatty hamburger, less surgary canned fruits and less salty food. Officials said there will be other steps, in time.

And there will be huge educational efforts by Agriculture and HEW directed at hundreds of thousands of doctors, nutritionists and school teachers.

The recommendations dodge many important issues, such as the fact that most beef, even lean beef, tends to be fatty, and the matter of possibly risky food additives, like nitritie and saccharin.

Nonetheless, the recommendations represent a vast turnaround in favor of consumers for the traditionally producer-minded Agriculature Department.

The seven key statements say:

"Eat a variety of foods" daily, from "selections of" fruits; vegetables; whole grain and enriched breads, cereals and grain products; milk, cheese and yogurt; meats, poultry, fish, eggs, and legumes (dry peas and beans).

"Maintain ideal weight," since obesity is linked to high blood pressure, diabetes and increased risk of heart attacks and strokes.

"Avoid too much fat, saturated fat and cholesterol" by eating in moderation foods like eggs, organ meats (liver, sweetbreads and kidney) and butter, cream and solid margarines. If you want to ear these, reduce intake of other fatty foods.

"Eat foods with adequate starch and fiber" -- starch for carbohydrates which provide energy and are low in calories unless flooded by fats, and fiber (in fruits, vegetables, whole grain breads and cereals) for healthy intestines.

"Avoid too much sugar" -- in frequent snacks, jams, jellies, candies, cookies, soft drinks, cakes, pies, breakfast cereals, ice cream, flavored milk and even catsup.

"Avoid too much sodium [salt]," which is in processed foods, sauces, pickled foods, snacks and sandwich meats, as well as the salt-shaker.

"If you drink alcohol, do so in moderation," because alcoholic drinks tend to be high in calories and more than one or two a day can be dangerous.

These recommendations represent a major vicoty for Sen. George McGovern (D-S.D.). His Select Committee on Nutrition issued a similar, though even more drastic, set of "Dietary Goal" in January 1977.

For more than two years, McGovern and some colleagues have been urging federal action. Many farm- and mcattle-minded members -- and food interests -- felt otherwise.

Some scientists, too, felt that one of the hottest issues -- whether fats and cholesterol in foods help cause heart and blood vessel disease -- remains unresolved. Public recommendations may cause disappointment and anger, they argued, if the recommendations prove ill-advised.

To this, Bergland and HEW Assistant Secretary and Surgeon General Julius Richmond replied that therecommendations are "only" the prudent "sonsensus" of most scientists today, not immutable or permanent rules.