A stranger approached me at a grocery store. “Do you need help finding something?” he asked. At first, I wasn’t sure what he meant. Then the realization kicked in: I was talking out loud, to myself, in public. It was a habit I’d grown so comfortable with that I didn’t even realize I was doing it.

The fairly common habit of talking aloud to yourself is what psychologists call external self-talk. And although self-talk is sometimes looked at as just an eccentric quirk, research has found that it can influence behavior and cognition.

“Language provides us with this tool to gain distance from our own experiences when we’re reflecting on our lives. And that’s really why it’s useful,” said Ethan Kross, a professor of psychology at the University of Michigan.

When we talk to ourselves we’re trying to see things more objectively, Mr. Kross said, so it matters how you talk to yourself. The two types of self-talk you’re likely most familiar with are instructional self-talk, like talking yourself through a task, and motivational self-talk, like telling yourself, “I can do this.” It might be corny, but motivating yourself out loud can work.