Troubleshooting tools

I am admittedly a fresh newbie here, but having 40+ years of programming experience (including control of laboratory instruments/protocols) and 2 days of Arduino experience, I have a couple of questions.
For troubleshooting purposes, how do you trap errors in sketches, and how to you list the public and private variable lists?
I have a MKR-Wifi-1010, and out-of-the-box, the example BLINK example does nothing. If I jumper pin 6 (per the specs) to the +5v, it lights, so software?, defective board?

So I tried Activity 1 - Temp and Humidity sensor exercise - cool - worked, but had some coding errors regarding text size, so I tried to fix them. FAIL! Now I don’t know where it’s failing. Even if I comment out everything after the last output (to the monitor), I get nothing. Is it still running? Did it die? I don’t know.

As a programmer, I want to wrap my code in a shell that traps and reports on (syntax) errors.
How do I do this?

I have no experience with MKR boards so no idea.

The usual approach to debugging in the Arduino world when using the IDE is just printing to the serial monitor (or other terminal program).

If you connected 5V to a pin on a 3.3V microcontroller, you might have damaged it.