William S. Sessions, a federal judge from San Antonio with a reputation for being tough but fair, was finally sworn in yesterday as the fourth director of the Federal Bureau of Investigation.

Attorney General Edwin Meese III introduced Sessions as a "consummate professional," saying "his competence is beyond question as a lawyer, as an administrator, as a prosecutor and most recently as the chief justice of the Western District of Texas."

Meese described Sessions as a man who believes that "every defendant must be treated with the fairness and respect that the Constitution and humanity require" but cited Sessions' "belief that, if found guilty of a serious crime, every defendant must pay the full price."

President Reagan, who attended the ceremony in the courtyard of the FBI headquarters building on Pennsylvania Avenue NW, said he will be counting on Sessions to "fight crime fiercely but always according to the due process of law."

At one point, he turned to Sessions and joked, "It is typical of your thorough and methodical manner that you got the ulcer out of the way before you started the job."

Sessions' swearing-in had been scheduled and postponed twice last month after he was hospitalized with mild ulcer attacks.

Reagan used yesterday's occasion to promote his nomination of Judge Douglas H. Ginsburg to the Supreme Court, saying Sessions and Ginsburg are concerned about the rights of crime victims.

Reagan said that, if the Senate confirms Ginsburg, he "would continue the trend toward a recognition that victims have rights, too, and so his Senate confirmation is vitally important to the fight against crime."

The president added that the country should focus more on "victims' rights, not just criminal rights. The next justice on the Supreme Court better be able to deal with that challenge, and Judge Ginsburg is ready."

Sessions, 57, was also praised by his predecessor William H. Webster, who left the FBI earlier this year to head the CIA.

"Good things are worth waiting for," Webster said, referring to the swearing-in's delay. "Your mission here is very little different from that from which you come. It is simple -- to uphold the law."

The oath of office was administered by former chief justice Warren E. Burger.

Sessions, who promised at his Senate confirmation hearing to maintain FBI independence and to refuse presidential orders that he might consider unethical, said, "My pledge today is truly unchanged. That is to lead in a fashion that unerringly and faithfully supports the Constitution and the laws of this great land.

"My hope is that, when my term is completed, my associates . . . will regret my departure, and my country will have been strengthened by my service," he said.

FBI officials said that Sessions has recovered fully from the ulcer attacks and that he is in good health.

Sessions is best known for his handling of the trial of the killers of U.S. District Court Judge John H. Wood Jr., known as "maximum John" because of the tough sentences he levied in drug cases.

Wood was murdered in 1979 by drug traffickers. Sessions took Wood's place in the case and, after 18 months of 24-hour-a-day protection by the U.S. Marshals Service, passed tough sentences on everyone convicted in the Wood case.

The Senate unanimously confirmed Sessions for a 10-year term.