You should do a few checks in order to jump to a conclusion, your Arduino may be just fine. As far as I know, Code cannot destroy a controller.
- Check if any other software is using the same serial port. Two softwares cannot use the same serial port at the same time
- Restart your PC and then try again
- Remove the Microcontroller from the board, connect it to the PC and try to open the com port. If it opens then connect your Tx pin with the Rx pin, send some data and check if you are getting the data back. This way you will ensure your USB-TTL converter is fine
- If this goes successful, then insert your microcontroller in some other board and check if it is getting programmed
I am sure after these checks you will find out the reason of the failure of your board/microcontroller.