I think it helps organize thoughts… and other times, you are rehearsing what needs to be said later, and you’re testing it out. Just as talking to a friend about something relieves anxiety, so does talkng to yourself, which I supsect is not really talking to “yourself”, it may be to a specific person who just happens to not be there, but it works anyway. Want to talk to your yourself in public without getting weird looks? Just put your ear buds in and act like you’re on the phone. Talk away.