There's that cliche, "If you think you can't, you can't," or something like that. The idea is that if you decide that you're not going to be able to do something, you'll self-sabotage and be unable to do it even if you have the inherent skill or resources. That's true, but it's only the tip of the self-talk iceberg.
You know those psychological studies where children are given the choice of a small prize now or a big prize later, and the ones who take the big prize end up having better lives in almost every regard? Well, a psychologist did that experiment in my middle school, and I took the small prize. Some people, myself included, have a natural tendency to prioritize the immediate.
So I want to rewire myself to be more long-term focused. To do this, I use self talk. Whenever I do something that isn't immediately satisfying, but is likely to have long term benefits, I pump myself up a little bit. So if I play good poker but lose money, I think to myself how it's good that I'm a profitable player, how well I did making good decisions even when losing money, and how good it is to be able to lose money and not freak out. I actually congratulate myself. If I resist buying a new laptop that I don't really need, I congratulate myself. If I push through a tough workout, I congratulate myself.
All of this seems silly, and would sound really silly if you could hear the internal monologue, but it actually works. The way we talk to ourselves really does affect our subconscious over the long term. That minuscule dopamine spike I get from praising myself every time I do something that is aligned with my goals creates little reward pathways in my brain that makes doing that thing easy next time.