If you can do either, you’re a developer ahead of the game of many others.
These are two of the most important skills when becoming a developer because at their core they speak to creating and fixing code.
Debugging – Walking through your own code to see if there are errors and/or running your own code to replicate errors.
Troubleshooting – Getting an error sent to you that requires you to dig through the code you built and the tools you have given yourself to identify the source of the problem.
One supports the other. Over time, I have become much better at troubleshooting, primarily because when I am debugging code, I am building tools and logs that will assist me and those I work with in better, more quicker troubleshooting.
Both are important skills to grow as a developer.