It sounds simple but what we think really does affect how we feel and behave. This is especially the case for children who may not yet have learned to self-regulate. 
For example, a child might say, “I failed this maths test – I am hopeless at everything” or “This project is so huge I don’t know where to start, so I might as well give up”. These sorts of thoughts can lead to behaviours such as not trying at future maths tests or giving up on large tasks. A more helpful strategy is to say, “I may have failed this maths test but I’m good at other things” or “I can manage this if I take it step by step”.
You can help your children overcome unhelpful thoughts such as these by learning to identify them and devising strategies to change their thinking. The best way to do this is to help children think through the reasons why they think a particular way. Say to them, “I can see how you might think that, but maybe there’s another way of looking at it”.
You also help your children by modeling ways of changing your own thinking. For example, when something goes wrong for you, you can say “It’s annoying when things don’t work out. I can do it another way instead”. This modeling helps children not only learn how to think about problems when they arise but also hear the language that explains what the adult is thinking.  
You may also be interested in the following KidsMatter resource: Emotional development: How thinking affects feelings