As a software engineer for many years, I helped develop systems for dealing with problems. One big lesson I took from this is that you have to be solving the correct problem.
One program I wrote reduced a pile of data to a one page report. The manager I wrote it for laid out the calculation as he wanted it, which is what my predecessor gave him. Sometime later, I was given the job of maintaining the report for a new manager. He didn't understand how the numbers could reach the result he was seeing, so I showed him the details of the calculation. My next task was to rework the calculation according to his new specifications. As far as he was concerned, the program was solving the wrong problem.
Take some time to consider whether your problem can be solved or not. After working on a Rubik's cube for a while, I realized someone had peeled off and exchanged a couple of the colored stickers, putting them on in a way that the puzzle could not be solved. Mathematicians have demonstrated that the value of pi cannot be calculated to the last decimal place because there is no last decimal in the calculation. In this case, they had the right problem but the problem cannot be solved. They settled for approximating a solution as closely as needed.
Sometimes nobody knows if a solution exists. There are a number of well known mathematical problems where nobody knows if a solution is possible or not. Solving one of these will make you famous in that community. The leading edge of science is almost all problems where nobody knows if a solution exists.
Whether our problems are logical, mathematical, personal or goals, your chances of success are much greater if you're focusing on the correct problem. If you don't know where you're going, any road will do, but you'll never know when you've arrived.