Most debugging advice is a list of tools. console.log, breakpoints, strace. Tools matter, but the thing that actually cuts my debugging time in half is a mindset: treat every bug as a wrong belief, not a broken thing.
Code does exactly what it says. If the behavior is wrong, one of my assumptions about what the code says is wrong. My job is to find which assumption, not to guess at fixes.
Start by writing down what you believe
Before touching the debugger, I write three or four sentences:
What I expected to happen






