When he lost his wife and 1-year-old daughter weeks after his first Senate win in 1972, and decades later, when his 46-year-old son Beau died of brain cancer, Joe Biden survived his grief because he found a sense of purpose.

In an interview with PBS NewsHour’s Judy Woodruff, the former vice president recalled a letter Ted Kennedy’s father, Joe, had written to a friend who lost his son in the mid 1950s. It was passed on to Biden by Ted’s wife Vicki.

Joe Kennedy wrote that when he lost his own son in World War II, he went through the “Why? Why me? Why did this happen? … What’s the purpose of life?” that so often accompanies grief, Biden recalled.

Maybe, Joe Kennedy mused in the letter, the purpose of his life was to think about what his son would have been doing if he were still alive, and dedicate himself to that.

“The day will come when the memory of the person you lost brings a smile to your lip before a tear to your eye.”

The advice Biden carries from that letter is that “there is hope and purpose devoting yourself to something that really matters, that matters to you, mattered to the loved one you lost,” said Biden, whose recent book, “Promise Me, Dad: A Year of Hope, Hardship, and Purpose,” reflects on Beau’s 2015 death and Biden’s decision not to run for president soon after.

Biden says for decades, he’s kept a cartoon of Hagar the Horrible on his desk. In one frame, Hagar stands beside his ship, driven into the rocks by a storm, yelling “why me?” into the clouds as lightning roars behind him. In the next frame, a voice from the skies asks: “Why not?”

It’s a reminder that “a lot of people are going through a lot worse than you’re going through, and the way they get through it is … they have people reach out, touch them, give them solace,” Biden said.

One of the best things that ever happened to Biden in the weeks after his wife and daughter’s fatal car crash — which also severely injured his sons Beau and Hunter — was a phone call from New Jersey Governor-elect Richard J. Hughes, whose wife had recently died.

Hughes told Biden that, in the beginning, every memory of the person you lost makes you feel as badly as the day you lost them. So Hughes started to keep a calendar, marking good days and bad days on a scale of 1 to 10. With time, those bad days grew farther and farther apart.

Now, Biden tells people dealing with their own grief, “the day will come when the memory of the person you lost brings a smile to your lip before a tear to your eye.”

Watch the full interview between former Vice President Joe Biden and Judy Woodruff on Thursday’s PBS NewsHour.