Visualization works because your mind doesn’t know the difference between real and imagined experiences. This can also work in a negative way when you replay mistakes over and over again, regardless of whether you do it out loud to a friend or to yourself in your mind.
If you’ve missed a spare or had a bad break, one of the worst things you can do is talk about it to everyone that’s willing to listen. By repeating the story of your mistake, you’re replaying the events in your mind over and over again. This will damage your confidence the next time you’re in that position.
Instead, acknowledge the bad break or the mistake you made, and then change subjects in your head by talking about something else, preferably your own or someone else’s good performance.