Debug ojs with visual studio code

My experience with Visual Studio is unhelpful for this question, but I can share my more general experience with PHP debugging. Perhaps a bit more context will help us help you.

What PHP debugger module do you have installed (Xdebug, DBG)?

Are you using PHP to spin up a built-in server (php -S), or are you running a different server locally (IIS, Apache)?