Are you talking about debugging code, or debugging the non-code workings of your form?
For code, you can start up your form in debug mode, set breakpoints and observe the values of variables at various points.
For non-code stuff, there isn't really any straightforward approach. You can temporarily create expression boxes, etc. to display the values of fields at various stages and use that to troubleshoot issues.