My wife said one of the most valuable things she learned in nursing school is: I keep a picture of a healthy patient in my head, and when I look at a new patient I zero in on how they look different from a healthy patient.
I've often thought about that and used similar mechanisms in my tech work.
Have an idea of what should happen, compare it to what actually happens.
Even if it's not the thing you're actively working on, something being out of place tends to stick out as wrong and will help you notice problems earlier. An example from pairing with someone at work recently: "Wait a minute, that ran way too fast, there's no way it actually succeeded" - indeed, it had failed in a way the system couldn't detect.
I kinda thought everyone does this at at least a basic level. How else would you realize your code has the wrong output?
I've often thought about that and used similar mechanisms in my tech work.