The 31-year-old actress says in the magazine's October issue that experiencing loss has changed her daily interactions, career and how she acts as a parent and friend.
She says she now looks at life from a "lens" where everything is "impermanent."
Ledger, 28, died in January 2008 after an accidental overdose of prescription drugs.
Williams plays another Hollywood star whose life was cut short, Marilyn Monroe, in the film, "My Week with Marilyn." It's about a week of Monroe's life in 1956 while filming the movie "The Prince and the Showgirl."
Williams says she tried to gain weight for the role to have some of Monroe's famous curves but it all went to her face. She opted instead to fill herself out with padding.
Williams says channeling Monroe made her feel "like being reborn."
The October issue of Vogue hits newsstands on Sept. 20.
"My Week with Marilyn" opens Nov. 4.
MORE FROM VOGUE: