Chuck Lorre was missing Billy Gardell.

Several years had passed since he and his producing partner Al Higgins worked with the “Mike & Molly” star. Energized by a recent trip to Africa, Lorre’s thinking evolved to the point where he decided that Gardell’s love interest in his new CBS sitcom, “Bob Hearts Abishola” — premiering Monday at 8:30 p.m. — should be a first-generation immigrant woman.

“They are the most ambitious, hardworking, focused, disciplined human beings you can imagine,” says Lorre, 66. “So we decided to do that.”

Still, they faced a huge problem. They couldn’t get a handle on the woman. “I can’t do this,” Lorre says. “How can we possibly write this?”

Before you can say “Google,” Higgins, 41, went to his computer and typed three words in the search box: “female Nigerian comic.”

Enter Gina Yashere. The London-born comic had just performed at the Montreal Just For Laughs festival and was looking forward to some R&R in New York. The phone rang. Her agent told her something hundreds of comics dream of hearing: “You’re getting on a plane to LA tomorrow. You’re meeting Chuck Lorre.”

Yashere’s internet videos convinced Lorre and Higgins that she’d be a perfect consultant on their new show, the plot of which was taking shape as the story of a man who falls in love with a Nigerian nurse. Yashere asked Lorre if he wanted her to play the nurse. After he said, “Not necessarily,” Yashere asked herself an important question: “What the hell am I here for?”

She was there to tell her story. Yashere’s parents emigrated from Nigeria to England and started from the bottom, despite their professional qualifications (her father had a Ph.D. and qualified to work as a lawyer back home). “My mom wanted us to have to avail ourselves of all the opportunities in England,” says Yashere, who was later cast as Abishola’s friend. “So she hustled to give us these opportunities. These stories started to go in [the show] and Chuck and Al said, ‘Let’s write this thing.’ ”

And that’s how Abishola was born. But who would play her? Again, Lorre, who has cast many hit sitcoms, was out of his comfort zone. “Finding someone to play opposite Billy was . . . prayer, really,” he says. Then Lorre gave a screen test to Nigerian actress Folake Olowofoyeku and says, “She just crushed it. Every moment in front of the camera is an honest moment. Funny and true and strong.”

“Bob Hearts Abishola” won’t operate like standard sitcom — Bob only meets Abishola because he has a heart attack and she is his nurse. “Waking up after a stent procedure is not your normal meet-cute,” Lorre says. “The wonderful thing about Abishola is she’s not looking. She’s here to make a living and get her son to a place of success.”

As much as “Bob Hearts Abishola” honors immigrants, Lorre also pays tribute to the small businessman in the character of Bob, who’s a compression-sock salesman. Are the writers in the writers’ room wearing them?

“We’re getting there,” Lorre says, with a laugh. “I’ve always been fascinated by the things we take for granted and see all the time and recognizing that, somewhere, someone made that. That’s what small businesses are all about. We’re not just a small business, we’re the best at what we do. That was part of Bob’s makeup.”

When asked if his new show — and the casting of African American actors in lead roles in many new CBS series — coincided with the exit of former CBS CEO Les Moonves, Lorre says, “It had nothing to do with it.

“We weren’t chasing this. As in, ‘Oh, it’s time for something diverse.’ What a dumb way to proceed,” he says. “That’s not writing a story. That’s chasing a political agenda. The character that Folake plays is to me a very admirable character. She’s the heart and soul of what it is to be an American.”