Yes, talking to yourself aids with task performance. It guides your behaviors especially with novel or confusing activities. Apparently, students who use self talk score highest on tests. Source
People who are depressed are more likely to overthink. They overthink about the negative things in life making them even more depressed. This then becomes a cycle that feeds onto itself making the depression worse.
I’ve learned that people will forget what you said, people will forget what you did, but people will never forget how you made them feel.