Summary - Notes from the popular article 'How to think like a programmer.' First, understand the problem, then come up with a plan, then break the problem down into steps. If you get stuck, take a breath and relax. Then, continue practicing.
1. Understand the problem
Q. How do you know if you understand the problem?
A. If you can explain the problem simply. "If you can't explain something in simple terms, you don't understand the problem." - Richard Feynman
2. Take some time to come up with a plan
Do not dive right into solving a problem without a plan. Give your brain time to analyze the problem after you have come to understand it fully.
Q. "Given input X, what are the steps necessary to return output Y?"
3. Break the Problem Down Into Steps
This is the most important part. Do not try to solve one big problem, you will cry. Instead, break the problem down into sub-problems.
Start with the simplest problem.
Q. How do you know which is the simplest problem?
A. It is the one you know how to solve (or almost able to solve).
Don't think of the big picture until you have solved all the sub-problems. Then, go back and connect the dots. At this point you can adjust the solutions of each problem in order to gear towards the big picture.
Reduce the problem until you can solve it on a small level. Then keep adding complexity.
4. If you get stuck - take a deep breath. It's okay.
Become motivated by the bugs. If you get stuck, that should arouse a desire to figure out what you did wrong. Don't get mad at the problem, but realize you must have done something wrong, now it is your job to simply figure out what you did wrong and fix it.
"The art of debugging is figuring out what you really told your program to do rather than what you thought you told it to do." - Andrew Singer
5. Practice Solving Problems
You will not be great at solving problems just because you read this article. It is important to solve problems if you want to get better at solving problems. And if you stop solving problems for a long time you will be rusty when you try to start solving problems again. Problem solving uses a muscle in the brain and that muscle needs exercise. In the same way that your times get better at running a 5K the more you do it. Stop for a while and your times will go back up.