Positive thoughts are important. The TV Series “Brain Games” does an experiment where someone bad at shooting a basketball is given a confidence boost and a good player is booed.
The bad shooter was able to make more shots. The good shooter now made less shots. This makes sense. If you believe you can do something, you will try. You will allow your body to exert itself properly. If you believe you can’t, then you may go through the motions, but you won’t put enough oomph in your throw.
The same with a mental task. Imagine your brain and knowledge as a myriad of filing drawers. If you believe you can find the answer, you will keep opening drawers. If you give up immediately, you don’t even open one drawer.