Robin Williams was an amazing man. It looked as though he "had it all" -- talent, money, wit, fame -- he was a comic genius. But the one thing he didn't have is the most important thing a man can have -- a close, loving relationship with God, his Creator. And that would have made all the difference!
No, he didn't need a "religion" -- he needed to know that mankind is put here on earth for a brief time to know God and to glorify Him, to enjoy this life with Him, to tell others of His goodness, and then to live with Him in a perfect place forever.
When a man (or a woman) has this assurance, no career decline, no debilitating disease, no relationship failure, and no personal loss can defeat him.