Federal, postal and retiree groups will spend millions of dollars over the next 18 months to keep current and future members from losing billions of dollars in pay and pensions in the 1980s, and to make sure they themselves stay in business.

Although the unions and professional groups would like to win higher pay and fringe benefits, their main goal is simply to hang on to what they've got. That won't be easy.

Chief among the potential problems facing government workers is President Carter's plan to reform the federal pay system.

His plan would eliminate national pay scales for most white-collar government jobs. Instead it would set up a system to tie federal salaries to the going rate in local private industry and match federal benefits (frequently better than those in industry) with those in the private market. It could result in slimmer government raises in years ahead.

Reform could be costly to the bureaucracy on another front. Under the Carter plan federal government salaries would, for the first time, be compared with wages and fringe benefits that go to state and local government workers. They outnumber their federal colleagues nearly 7 to 1, but trail far behind in average pay and fringe benefits.

The president also would separate future military pay raises from boosts that go to white-collar civilians. That link has often been beneficial to federal employees, since congressional supporters of the military have pushed for maximum pay raises for government civilians so military personnel would get equal treatment.

Meanwhile, 600,000 postal workers are afraid technology may force many of them out of work. A new generation of machines and equipment are now available that could render many postal jobs obsolete - unless the U.S. Postal Service can enter the electronic field.

President Carter has promised new guidelines for moving mail. But they have been delayed as private industry groups lobby the white House for a major role in delivering the nation's billions of letters and messages that now move under a federal monopoly.

Congress is likely to approve a payments change for federal and postal retirees that would cost them $500 million a year in future cost-of-living raises. Both the Senate and House have approved budget language that would eliminate cost-of-living raises that retirees now receive every six months. Instead, federal-military pensions would be subject to a formula, like that of Social Security, that gives a singel annual inflation-catch up eac July 1.

Mandatory social security coverage to replace current retirement plans for the federal work force is also a serious "threat" to government employees, no matter what their age group.

The federal civil service retirement program is one of the best in the nation. Federal employees contribute more to it than private industry workers do for social security. Even though civil service benefits are taxable and cost more, the payout at retirement under the staff system is more than double that under social security.

Insiders predict that groups studying the possible merger of the two pension systems will recommend it, and that President Carter will go along. Union and retiree groups are focusing most of their lobbying at the plan that they say would hurt bureaucrats unfairly, despite promises that nobody now in government would be hurt.

Patrick J. Nilan, chief lobbyist of the American Postal Workers Union, is warning members that being "grandfathered" into the civil service system would mean little in years ahead. Michael Nave of the National Association of Retired Federal Employes also says that the two systems - social security and civil service - must be kept separate.