Fixing bugs in Blender add-ons can be a bit painful without a proper debugger. Luckily, it’s pretty easy using the debugpy package and this small Blender add-on that helps install and start it. Once it’s running, Visual Studio Code or Visual Studio 2019 v16.6 or later can be used to debug your add-on!
All the details on how to install the add-on and debug using Visual Studio Code or Visual Studio 2019+ can be found on the add-on’s GitHub repository.