How to prepare
“Each problem that I solved became a rule which served afterwards to solve other problems.”
The best way to get good at solving problems is... to solve problems! A new problem is rarely unique. When you strip away the details of a problem and look for the fundamentals, you often discover that it's a problem you've already solved. The more problems you solve, the more likely you are to see patterns you can act on.
Question your understanding of the problem. We all carry assumptions and preconceptions that make problems harder than they need to be. It's easier to recognize a familiar problem when remove complications and leave just the core behind. When you can't find patterns, you can still draw on experience. If you know how to solve a similar problem but that solution doesn't apply to the new problem, why? Knowing what makes this particular problem unique may help guide you find a solution.
When experience seems irrelevant, you can still learn from the techniques used to solve other problems. Sometimes you make progress on a problem by solving just a special case, or a deliberately simplified version of the problem. With other problems, the best strategy is to fully generalize the problem instead!
No matter what — just try something. There are too many problem-solving strategies to list here (and they often directly contradict one another). The more you learn and try, the more tools you'll have to solve new problems. Develop your intuition. Learn to listen to that voice in your head with a crazy idea. When you don't know what to do, the best thing to just do something. The more things you know how to do, the more likely you are to succeed.
You've spent a large part of your life solving problems. This experience is your problem-solving toolbox, which you'll develop throughout your life. As you tackle more problems, you learn more solutions and techniques and ultimately become a better problem-solver.