The tricky thing about the boards with native USB capability like your Nano 33 IoT is that the USB code that creates the CDC serial port is running on the same microcontroller as your sketch. This means your sketch code can break the USB code, or stop it from running. When that happens, it no longer presents a port.
This can be unexpected to those who previously mainly worked with the boards like Uno and Mega with a dedicated USB chip that can never be affected by the sketch code.
The missing port makes it so you can't upload normally any more. However, the situation is really not so bad because there is an independent program called the bootloader in a separate section of memory from your sketch, and that program has its own USB CDC code. So even if the sketch is completely broken, you only need to activate the bootloader and you will get a port back and be able to upload.
Fortunately, there is an easy way to activate the bootloader and recover from this situation:
Press and release the reset button on your board quickly twice. You should now see the LED on the board pulsing, which means the bootloader is running. The double press causes the bootloader to run indefinitely (until the board is reset, powered off, or an upload is done), which means you don't need to get the timing of the reset just right.
Select the port of your board from the Tools > Port menu. The port number may be different when the bootloader is running so don't assume you already have the correct port selected.
Start an upload in the Arduino IDE.
The upload should now finish successfully. After this, you should be able to go back to doing normal uploads without needing to press the reset button. If you still need to do the reset trick to do uploads after this, the problem may be caused by your code. You can verify this by uploading a simple sketch like File > Examples > 01.Basics > BareMinimum.
A double press of the reset button causes the yellow LED to pulse slowly but the port does not show up in IDE or device manager. I know the cable is good as it will talk to my debugger (Alex Taradov's CMSIS-DAP SWD).
I see there is an option to burn the bootloader via the debugger. I may give that a go.
Update:
The port was gone. The deeper problem is with my USB hub, or maybe it is the board code. The board shows up immediately if I plug straight into the PC but it is not recognized via the hub. I have had this hub for at least 5 years and never had this problem before. It only has 4 ports though so it will be replaced first paycheck in January.
BTW, I have been searching the documentation and have far to go it seems. Where did you find info about accessing the boot loader USB?
Unfortunately, Arduino has done a very poor job of communicating this essential information to the users of the modern native USB boards that support it.
However, it is documented in the Nano 33 IoT datasheet which is available for download from the product page:
All Arduino boards have a built-in bootloader which allows flashing the board via USB. In case a sketch locks up the
processor and the board is not reachable anymore via USB it is possible to enter bootloader mode by double-
tapping the reset button right after power up.
Note that the "right after power up" is erroneous. The double reset has the same effect no matter when you do it. I can't comprehend why they wrote such a thing.