Get control, extend control.
Getting control means making the system do something of your choosing. It’s not the thing you really want (until you’re done), but it’s something you decided. In your case, printing.
Extend control means make it do something else you want. This should be a small step. It’s surprising how few small steps you need to get a pretty complex system going. Here you might print from the function you’re fixing.
Sometimes when you go to extend control, the system won’t do what you want. You’re surprised. This means you’ve lost control. The good thing is because you took a small step (right?) the problem is now in a narrow space.
Get control again. Either go back to what you did before, or take the smallest possible step forward from there.
You will spend all your time with a system you either can control or nearly can. This ways of debugging is slower than how most people do it in the median case, but much faster in the mean. Debugging time is dominated by the worst cases, and this real cuts down on those. Especially the ones that make you feel dumb.
A critical thing is to not just “check” but “do”. If you have a computer that won’t power up, you don’t just check it’s plugged in, that’s not controlling anything. You plug in another computer or electric heater.
This way of working is rather peaceful. Much less frustrating than how most people do it. The most frustrating part is when someone asks for your help and tells you not to bother checking that thing, they know it works. And that part, and that part, and that part. But somehow this system they have complete confidence in as parts doesn’t do what they want in the whole. Best phrase for this situation:
“Well, let’s just try it for fun.”