The Tick, Tick...Boom! actor, 38, spoke with his The Social Network costar Dakota Johnson for Vanity Fair in which he recalled working with Ledger on his final film, 2009's The Imaginarium of Doctor Parnassus. Ledger died at age 28 on Jan. 22, 2008, in the middle of the film's production. Actors Johnny Depp, Jude Law and Colin Farrell joined the cast to help complete Ledger's role.
Garfield played Anton in the Terry Gilliam–directed film, which also starred Christopher Plummer.
The topic came up when Garfield was speaking about mourning someone in order to keep their "spirit here with us no matter if they die at 35 or 80."
"When anyone dies, we want the beauty of keeping their memory alive by talking about them and by repeating stories over and over again," he said. "I think especially with someone who died so young — I remember feeling it with Heath. I don't know if you knew Heath?" he asked Johnson, 32, who replied, "I didn't know him."
Continued Garfield, "He died in the middle of a film that we were making together. And also he was just obviously such an incredible artist and a gift to the world, and I think the same goes for Jonathan [Larson, the Rent composer whom Garfield plays in Tick, Tick...Boom!]."
"It was like the amount of people that want to keep his spirit alive enabled us to get all of the information and all of the subjective experiences that people had with him, and I love that," he added.
Justin GoffUK Press via Getty
Never miss a story — sign up for PEOPLE's free daily newsletter to stay up-to-date on the best of what PEOPLE has to offer, from juicy celebrity news to compelling human interest stories.
Garfield previously opened up about working with the late Oscar winner on Doctor Parnassus.
He told New York magazine's Vulture in May 2008, months after the star's death, "The amount of stuff he left me with was astonishing. I will never ever lose hold of what he had to offer. He just had this total spontaneity and the ability to do anything at any point: fly off the handle or joke."
"It was electrifying and I never knew what he was going to do — like punch me, you know? But how he did it is a mystery to me," Garfield added at the time.
In 2009, Garfield told Entertainment Weekly about learning he was cast in Doctor Parnassus when Ledger told him at Garfield's 24th birthday party. "He came to my party, gave me this really big hug, and said, 'Welcome to the family.' "