How to run n8n in debug mode with VSCode?

Inspired by this post and other resources I made a reply to my post about how to debug it in VSCode. I may overlap a little bit, but there are new stuff that may be useful, in particular to beginners.