Read the error message. The whole error message.
The single most common cause of wasted debugging time is not reading the full error message. Most errors tell you exactly what went wrong and often where. Developers habitually skim errors and then spend an hour on Stack Overflow solving the wrong problem. The habit to build: when you see an error, stop, read the entire message including the stack trace, then Google only after you've understood what the error is actually saying.
The answer is usually in the error. Reading it feels slow; not reading it is slower.