My favorite tip is "Stop Thinking and Start Looking".
Looking at the error and trying to deduce where the problem can work.
But normally, you need to run the code and observe what happens. When what does happen differs from what should happen, you can zero in on the bug empirically.
This process is typical a binary search, which finishes in a few steps, as opposed to the intellectual riddle solving.