WILL SMITH is guilt-stricken for failing to help his “Fresh Prince of Bel-Air” co-star James Avery conquer his weight woes, says a source.

The 6-foot-5 actor, who’d bal­looned to as much as 300 pounds, died at age 68 on New Year’s Eve of complications from open heart surgery.

“Will’s devastated right now,” said a source close to Smith, 45. “He loved James just as if he was a member of his own family.”

Will posted a tribute to Avery on Facebook, say­ing: “Some of my greatest lessons in acting, living and being a respect­able human being came through James Avery.”

“Fresh Prince” aired on NBC from 1990 to 1996, and Will’s character often needled Avery’s character, wealthy Uncle Phil, about his weight.

“But off camera, James’ weight was no laughing matter,” said the source. “Will tried to get James to work out and pare off pounds. But it wasn’t until the show was long over and James had problems with his legs and feet that he finally lost weight.

“By then, the damage to his body was already done.”

Avery was diagnosed with Type 2 diabetes in 2000, and in 2010, he participated in a webcast to raise awareness about it.

“It’s a horrible dis­ease,” said Avery. “It eats you up piece by piece.”

He also admitted that, at first, he was in denial about his di­agnosis and neglected his health. As a result, he had problems with his foot that required him to frequently use a wheelchair or walk with a cane.

“Will feels that he should have pushed James harder to take care of himself,” said the source.  “If he had, James might still be alive today.”