It takes some confidence to extend the Broadway run of your one-man show before opening night, especially a few months after undergoing heart surgery. But then Robin Williams has never been short of nerve. His lengthy career is due in equal measure to the fearless nature of his comedy and to the frenetic energy of his performance: he has a reputation as an entertainer that is built as much on his nerve as it is on his nerves.

Now, after six years away from the stage, a relapse into alcoholism, a divorce and an emergency operation to replace a faulty valve in his chest, Williams is resuming live stand-up. His comeback show, which reopens on Monday, is already one of New York's hottest tickets, and then later in the week a Disney film, Old Dogs, in which Williams co-stars with John Travolta, opens in cinemas across America. What will follow is a series of wiser, more sensitive choices.

Rather like the legendary Fisher King, the character he once played on screen for Terry Gilliam, our dishevelled hero has returned, ruined by life but still searching for that grail. "It's the idea of going, 'Relax, you got the gig, what do you want to do now?'" Williams has explained to his fans.

Williams, who studied drama at the renowned Juilliard School of Music and Drama with fellow student and close friend Christopher Reeve, first made his name on the comedy circuit in the late 1970s alongside such emerging beacons of the alternative scene as John Belushi, Bill Murray and Richard Pryor. Once he made it to Hollywood his fortunes rose steadily, riding on the success of his Oscar-nominated portrayal of the DJ in Good Morning, Vietnam, until the point came in 1993, with the release of the hit family comedy Mrs Doubtfire, that Williams could justly claim to be one of the biggest box office draws in the world.

In the late 1990s a dangerous relationship with drink served to rub some of the shine off Williams' star, but he kept on working. He was set to return to Broadway for a short live engagement and the appetite of his audience was clear. Tickets reportedly sold out in less than 10 minutes.

But then fate struck. Williams, who had been feeling a little out of breath and could not shift a persistent cough, was given an angiogram that uncovered a serious problem with a heart valve, a valve that was, in the comic's words, "just blown". The tour was put on hold while he underwent surgery.

It seems the realisation of just how close to death Williams had unknowingly been, more than the impact of major surgery itself, has jolted the performer into a new appraisal of his life and values. "I think, literally, because you have cracked the chest, you are vulnerable, totally, for the first time since birth," he has said.

It is not that he has not had mortal shocks before. In 1982 he was with his old friend Belushi the evening before he died of a drugs overdose in the Chateau Marmont hotel, and in 1995 the serious horseriding accident and subsequent early death of his close friend Reeve had a profound impact on his life. Yet since his recent surgery Williams has spoken of a fresh thirst for life.

A close brush with death has given the 58-year-old a new perspective. He met his friend Susan Schneider, a 45-year-old graphic designer, shortly before his operation and she nursed him through convalescence at his California home. (Last year Williams separated from his second wife, Marsha, after 19 years of marriage).

A warm wave of nostalgia is washing through America this month in anticipation of seeing Williams perform again. It has prompted shared memories of some of the staging posts in his career: there was the early playful television appearance on the Richard Pryor Show, and then Williams in the guise of the alien Mork from Ork encountering Henry Winkler's Fonz on Happy Days. (This was the part that spawned the spin-off sitcom Mork and Mindy which ran from 1978 to 1982 and made him a household name).

Far from looking back though, the actor says he is searching for work that will mean more to him. He cites a dark comedy released in America this summer, called World's Greatest Dad and directed by Bobcat Goldthwait. It is the kind of work he hopes to make more of now.

The highlights of Williams's film career so far are the roles that have suited his extraordinary energy level or caught the mood of the times, films such as The World According to Garp and Good Will Hunting. Latterly, Williams has also enjoyed critical success in a number of spooky parts, which mysteriously also seem to fit him like a glove, for example as an obsessive in One Hour Photo or the sociopath in the thriller Insomnia.

But as the camera has rolled on through the years, Williams's more unfortunate choices have stacked up too. Flops have included Bicentennial Man, RV, Patch Adams, Jack and Robert Altman's Popeye, of which Williams has said: "If you watch it backwards, it has a plot."

Though Williams may be born again, his new show will not be evangelical. While the star has learnt his own lesson in relation to booze and still attends AA meetings, he says he does not want to preach. All he can tell people, he has said, is simply not to do it.

"There's nothing romantic about it. This idea that as an artist you have to push yourself and explore the dark side? I went there. You can do a lot more interesting stuff when you're not messed up," he explains.

All the same, Williams's friend and fellow comedian Billy Crystal believes the stand-up show will offer some kind of therapy for the performer. "Over the last couple of years and the pain that he's gone through, his brain is the one thing that's kept him buoyant," Crystal has said. "I think he needs the stand-up in a different way than he did before. It's still a safe place for him to be, but he can talk about things and make himself feel better, not just everybody else."

Eric Idle suspects that all the Williams voices are an elaborate piece of misdirection: "I've always felt that Robin's blinding speed and flash of wit was an effort at concealment, rather than revealing," said Idle. "He would be talking about something personal or sexual, but it was always in general, not about him."

Whether or not Williams's attention-seeking behaviour is designed to communicate more openly or to hold his audience at arms' length, the entertainer is clearly more determined than ever to shake people into noticing more about their lives, just as he has been forced to take account of his own.

Even before his illness, Williams spoke strikingly about his drive to go out in front of an audience and talk. "There's anger there, and a fear, too," he said. "I want to shout, 'Wake up! Snap out of it!' The hypnosis is over!"

• This article was amended on 27 November 2009.

