The 90-year-old told around 300 people at Maranatha Baptist Church in his home town of Plains, Georgia, to be faithful to God, even when given bad news.
"Say, 'God, I'm really troubled and I ask you to give me the strength to bear whatever I have on my shoulders and to face whatever comes to me'," Mr Carter said.
The statesman regularly gives the lessons and has been teaching classes since his teens.
Mr Carter said a tumour showed up on an MRI scan after he sought treatment at Emory Hospital in Atlanta. He said he first felt sick while he was in Guyana in May to monitor an election.
He added that he underwent surgery to remove the tumour on his liver on August 3.
He recapped the details of his health at Maranatha Baptist Church but moved on after a few minutes.
"That's enough of that subject," he said before beginning the lesson on faith, love and personal relationships.
Gesturing frequently as he spoke, Mr Carter made direct eye contact with many congregants and occasionally glanced over to the left side of the church where his wife sat.
The president then left the church and went to a nearby high school to give a Sunday school lesson.