Did my code destroy the arduino?

One such "connection" is the Arduino IDE's Serial Monitor. The Arduino IDE is able to control its Serial Monitor to close the port before an upload, then open it again after, so this is not a common cause of a failed upload. However, if you open multiple instances of the Arduino IDE by starting it multiple times or opening multiple sketches directly, then one instance of the IDE is unable to control the Serial Monitor of the other instance and so you must manually close the Serial Monitor of one instance before uploading in the other.

Arduino IDE windows created via the File > New, File > Open, File > Sketchbook, or File > Examples menus are all of the same IDE instance and so are able to control the Serial Monitor as needed.