An ailing Arnold R. Miller, who presided over some of the best and some of the worst of times in the United Mine Workers, resigned yesterday as head of the coal miners' union.

Miller's hand-picked assistant, Vice President Sam Church Jr., a beefy, aggressive 43-year-old Virginian, promptly was elevated to the presidency by the UMW executive board.

Miller's departure, amid considerable controversy, came 10 years after the birth of the rank-and-file revolt that subsequently deposed W.a. (Tony) Boyle and swept Miller and fellow reformers into office in 1972.

Church, ironically, was a supporter of Boyle in his 1969 race against Joseph A. (Jock) Yablonski and again in 1972 when Boyle lost to Miller in a court-ordered rerun of the 1969 election.

Boyle subsequently went to prison for his role in the murder of the rebel Yablonski, but the reforms and democratization brought to the union by his successors paved the way for the Miller-Church alliance.

Rumors of Miller's departure due to failing health had floated across the coalfields for weeks, fueled by Miller's public accusations that Church was trying to force him out of office.

Church denied yesterday that he or anyone else from the 170,000-member UMW had asked for Miller's resignation. Nor was there a hint of that earlier acrimony in the letter of resignation Miller sent from his hospital bed in Charleston, W. Va.

Since last week Miller has been in an intensive-care unit in Charleston, after suffering a heart attack -- another in a lengthy series of physical ailments -- while hunting in West Virginia.

His letter of resignation said his physical condition made it "impossible to continue to serve effectively." He sent along best wishes to Church as his successor.

The UMW's executive board, in accepting the resignation, designated Miller as president emeritus -- a position also given to the late John L. Lewis when he left the helm -- and directed that Miller continue receivingreceiving his full salary of $40,000 annually until the end of his term, December 1982.

The smoothness and grace of the change of command yesterday, with Church praising Miller and pledging to unite the UMW, was a sharp contrast to the stormy years of Miller's stewardship.

Miller, quiet and retiring, rose from obscurity as a spokesman for the black-lung compensation movement that swept West Virginia in 1968 and 1969 to worldwide attention as the leader of the UMW reform movement.

Spurred by Yablonski's son Chip and Washington attorney Joseph L. Rauh Jr., Miller and his reform slate took over the UMW and quickly installed democratic procedures unknown to most miners -- contract ratification, district elections, a wide-open union newspaper.

But the Miller regime was buffeted as much as it was helped by the changes. Boyle loyalists and other critics challenged Miller at every turn; miners reacted bitterly to his frequent absences from labor hot spots.

By 1977 Miller had broken with most of his old allies in the reform wing of the UMW. The coalfields were near anarchy -- disgruntled miners losing almost 2 million man-days of work that year in wildcat strikes that the union was unable to control.

The cap on all this was a 109-day contract strike in 1977 and early 1978, prolonged by the miners' rejection -- using the ratification vote Miller had given them -- of his initial effort to settle with the coal operators.

Since the settlement, however, the coalfields have been relatively calm, although the union hierarchy has continued to bubble with political intrigue and dissent.

Coal industry sources give some credit to Miller's successor as a key player in lessening friction between the union and the Bituminous Coal Operators Association.

"the industry tends to think that Church has grown into every job he has had," one source said. "Sam was one of those who recognized that things could not go on in their chaotic way. He has been a force in keeping down the public bickering among UMW officials."

In that vein, Church declined several times yesterday in a meeting with reporters to criticize Miller or the coal operators. His inaugural statement emphasized his "greatest desire" to unite all UMW members and bolster sagging coal markets.

Known throughout the union as a tough talker who doen't shy from violence (he once punched a UMW attorney he thought had criticized Miller), Church acknowledged he might even work on that image.

"maybe I won't be as aggressive," he said, smiling.