Nano 33 IoT and Neopixel strip

The tricky thing about the boards with native USB functionality like your board 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 that have 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. The bootloader can activated manually via the double reset technique you have learned.

My guess would be that there was something in your LED sketch that broke the USB code. You can test this by uploading that sketch again to see whether the problem comes back. Now that you know how to easily recover the board from that state, it is nothing to be afraid of and you can proceed to finding what it is in the sketch that is causing the problem.