What would you do if you knew you were going to die? It’s an age-old question many have struggled to answer. One person who has come up with an admirable approach is Sam Simon, one of the central creative forces behind “The Simpsons.” The renowned writer-producer recently revealed on the “WTF with Marc Maron” podcast that he has been diagnosed with terminal colon cancer, and has three to six months left to live.

Even though Simon walked away from “The Simpsons” in 1993, he still gets credited as a co-executive producer and receives royalty checks from the show worth “tens of millions.” Simon told the comedian Maron he plans on giving all of it away to charity before he dies.

As the Hollywood Reporter noted, Simon, 58, is considered one of the most charitable people in Hollywood. He’s made sizeable donations to the People for the Ethical Treatment of Animals -- which named its Norfolk, Va., headquarters after him -- as well as Save the Children and the Sea Shepherd Conservation Society. In 2011, he founded the Sam Simon Foundation, an organization that rescues stray dogs, spaying and neutering them for free. They also provide vegan food to needy individuals and families, as well as hearing dogs for the deaf and service dogs for veterans.

In an interview with the Hollywood Reporter, Simon spoke about his philanthropic endeavors. “I was never that hands-on with any of it,” he said. “I’ve just been fortunate to find great people to run things. Frankly, one of the pleasures of the foundation is hanging out with the people because they are some of the nicest people in my life.”

As someone who made his fortune working in television, Simon has vowed to donate virtually all that he has left. “The truth is, I have more money than I’m interested in spending,” he said. “Everyone in my family is taken care of. And I enjoy this.”

When asked why he has devoted most of his post-“Simpsons” life to charity, Simon boiled it down simply. “One thing is, I get pleasure from it,” he said. “I love it. I don’t feel like it is an obligation. One of the things about animal rights, which is not the only thing that I care about in this world, is that your money can bring success. I see results.”

In the interview, Simon also expressed his desire to expand the foundation and promote veganism, as well as his current treatment regimen and television work schedule.

Simon first burst onto the scene as a young writer on the popular situation-comedy “Taxi” back in 1981. He eventually became the series showrunner before moving on to write and produce other sitcoms such as “Barney Miller,” “Cheers” and “It’s Garry Shandling’s Show.” In 1989, he co-developed “The Simpsons,” which remains on the air to this day.