The song you're thinking of is "He Will Answer By and By" from the TV series The Cosby Show.
In the episode, Denise gets a job as a teacher, and Cliff and Claire sing this gospel-style tune as a playful reminder that life won't always be easy for her.
The lyrics include the refrain: "He will answer by and by, he will answer by and by, and he will answer by and by, when we are all gone."
It's a sweet, humorous moment that highlights the Huxtable family's faith and close bond.