I am often asked the question, "How do I figure out how to diagnose this programming problem?"  Most often I point to experience and practice as the best ways to know what to do first.  Rob Pike gives some of his advice from his time working with a colleague:

When something went wrong, I'd reflexively start to dig in to the problem, examining stack traces, sticking in print statements, invoking a debugger, and so on. But Ken would just stand and think, ignoring me and the code we'd just written. After a while I noticed a pattern: Ken would often understand the problem before I would, and would suddenly announce, "I know what's wrong." He was usually correct.

Read: "The Best Programming Advice I Ever Got"