(CNN) -- It's getting a bit cliché: An apologetic politician admits to the public that, yes, he too has been caught in a sex scandal.

Ex-Gov. Eliot Spitzer, with wife Silda, didn't have a lot of political goodwill built up, Paul Gallagher says.

But fortunately for those philandering politicians, the admission of an affair doesn't have to mean the end of a career. Paul Gallagher, the co-chief of the U.S. crisis team at the public relations firm Burson-Marsteller, has some helpful tips for surviving the aftermath.

Political goodwill

Having an affair is no way to make friends, but solidifying support before a liaison could help cushion the fall.

Take former President Clinton, who lied under oath about his relations with intern Monica Lewinsky but was acquitted of perjury and obstruction of justice charges. Two years later, Clinton left office with some of his highest approval ratings.

The political goodwill Clinton built up by reforming welfare and balancing the budget, coupled with a tough year for Republicans, helped Clinton hang on to his job, Gallagher said.

"At the time of the Lewinsky scandal, Clinton had a pretty good reservoir of Democratic support, and public opinion was also sort of turning against the Republicans at the same time," Gallagher said. Lessons from past political sex scandals »

Clinton took office in 1993, but after his failed attempt to overhaul health care and repeal the ban on gays in the military, House Speaker Newt Gingrich and Republicans gained control of Congress.

Don't Miss

By the time Clinton's extracurricular activities were revealed, those pointing the finger were facing their own battles. Gingrich had become a polarizing figure, and after a disappointing 1998 midterm election for Republicans, he stepped down from his leadership post.

(Gingrich later admitted that about the time he was going after Clinton, he was cheating on his wife. Gingrich said that didn't make him a hypocrite because Clinton was impeached not for having an affair but for lying about it.)

Spitzer, a former state attorney general whose reputation as a scourge of white-collar crime propelled him to the governor's office in 2006, faced allegations -- but no charges -- that he was tied to an international prostitution ring ensnared in a federal investigation.

Spitzer, who had approved an increase in the penalty for those patronizing prostitutes, publicly apologized for his "private failings," and two days after word of his involvement was reported, he stepped down as governor.

The Democratic governor, Gallagher said, had "not a lot of goodwill at all, had really burned a lot of bridges. His whole governing style has really alienated a lot of people."

The nature of the offense

The public has, in many ways, become numb to the run-of-the mill affair, but if someone's sexcapade has salacious details, brace for an onslaught of media attention.

That was the case with Democrat Jim McGreevey, who announced on television that he was gay, had an affair with a man and was resigning from his post as governor of New Jersey. McGreevey said "it makes little difference that as governor I am gay," but what did make a difference that he was married and had two kids.

Along the same lines, don't follow in the footsteps of former North Carolina senator and Democratic presidential hopeful John Edwards who outraged the public by having an affair and denying it while his wife was publicly fighting cancer.

Although South Carolina Gov. Mark Sanford's confession to his "sparking" involvement with an Argentine mistress was far from perfect, Gallagher says, he at least seemed sincere.

"Sanford professed that this was a matter of the heart, that it was love that made him do it, and I think people kind of can understand that. ... Edwards' offense -- the nature of it was exacerbated by the fact the he was cheating on a woman who was facing a grave illness, and that made his infidelity different. There was more of a sense of outrage about what he did," Gallagher said.

Breaking the law is also something to avoid. Don't use state funds to cover your tracks, and don't put your mistress on your payroll.

Rep. Wayne Hays, D-Ohio, learned that the hard way more than 30 years ago, when The Washington Post quoted former secretary Elizabeth Ray as saying her main duty had been to have sex with Hays. Ray, who was paid $14,000 a year, also claimed that she didn't even know how to type. Hays admitted to an affair but denied that Ray's sole purpose was to serve as his mistress.

The news cycle

The "ebb and flow of the news cycle" plays a key role in determining the fallout from a sex scandal, Gallagher says.

"I have to believe that Sanford, a factor in his ability to survive was the fact that Michael Jackson's death sort of diverted the media's attention," he said. "Building up to the days before [Jackson's] death, there was pretty much widespread agreement that he was going to lose his job ... and reporters were pretty much camped out at the capitol in South Carolina, waiting for the news."

Crafting the announcement

When the time comes to drop the bomb, "the golden rule in handling it would be get out in front of it as quickly as possible," Gallagher said.

Tell the whole truth, but be concise. Rip the Band-Aid off in one swoop, Gallagher said. "Don't take it off in inches, because it always hurts more."

This is where Sanford took a wrong turn.

"Sanford violated a number of rules. Misleading your own top aides and having them mislead the press corps is never a successful strategy," Gallagher said.

After disappearing for nearly a week -- and telling his aides he was hiking the Appalachian Trail -- Sanford was spotted in the Atlanta, Georgia, airport, returning from a visit to his Argentine mistress.

He confessed to his misdeeds in a rambling news conference that quickly got off to a bad start.

"I won't begin in any particular spot," he opened, indicating that this would not be the ideal concise confession. In the 18 minutes that followed, he gave far too many details about "that whole 'sparking' thing."

In the days that followed, Sanford's story slipped from the headlines as the media refocused their resources on the death of Michael Jackson.

But, just when it looked like Sanford would get a free pass, he resurrected the story in an hours-long interview with The Associated Press.

Sanford confessed that he'd "crossed lines" with other women. He also revealed that he visited his mistress more times than he originally said and that she was his soul mate, not his wife.

"Clearly, a tale like Sanford's, that is kind of really nutty, gets a lot more attention and stays in the headlines and thereby raises the risk to the politician," Gallagher said.

Sanford, once a rising star in the Republican Party, will now have to rethink his trajectory.

"The talk of him being a presidential candidate? Nobody's saying that anymore," Gallagher said.

But all is not lost once a politician transgresses, and there is reason to believe that Sanford can recover, as others have before him.

In 1987, Gary Hart dared the media to catch him in an affair. At the time, he was the front-runner for the 1988 Democratic presidential nomination. He dropped out of the race after he was photographed with a woman said to be his mistress. Hart was never elected to office, but he was appointed by Clinton to what was known as the Hart-Rudman commission on national security.

And despite two failed marriages and an infidelity, Gingrich has re-emerged as a leading voice in the Republican Party.

Could Sanford one day follow suit?

"I think Sanford certainly isn't as powerful, and it will be interesting to see how the remainder of his term plays out and then what he does afterward, but I think Newt Gingrich again offers hope," Gallagher said.