I've written a small Blender plugin to help remote debug Blender plugins. Now that's a mouthful.
This allows the setting of breakpoints in your editor, and stepping through the code. It was mainly written to be compatible with VSCode, hence the name. But some other editors also support connecting to ptvsd (edit: it has been changed to use debugpy now).
Full documentation is available on github, but I've also made a video over on my art youtube channel, showing how to set it up and use itfor beginners.