Mr. Obama spoke repeatedly of the role of social media in activism specifically, including the idea of what’s become known as “cancel culture,” which is much remarked upon, but still nebulously defined. It tends to refer to behavior that mostly plays out on the internet when someone has said or done something to which others object. That person is then condemned in a flurry of social media posts. Such people are often referred to as “canceled,” a way of saying that many others (and perhaps the places at which they work) are fed up with them and will have no more to do with them.

[What’s cancel culture really like? Ask a teenager. They know.]

Mr. Obama talked about conversations he’s had with his daughter Malia, who is a student at Harvard with Ms. Shahidi.

“I do get a sense sometimes now among certain young people, and this is accelerated by social media, there is this sense sometimes of: ‘The way of me making change is to be as judgmental as possible about other people,’” he said, “and that’s enough.”

“Like, if I tweet or hashtag about how you didn’t do something right or used the wrong verb,” he said, “then I can sit back and feel pretty good about myself, cause, ‘Man, you see how woke I was, I called you out.’”

Then he pretended to sit back and press the remote to turn on a television.

“That’s not activism. That’s not bringing about change,” he said. “If all you’re doing is casting stones, you’re probably not going to get that far. That’s easy to do.”