Try to use the debugger, learn breakpoints and watches. Unsure what IDE you use, but if you use Intellij, this will get you started very quickly.
https://www.youtube.com/watch?v=lAWnIP1S6UA
Very interesting. I can change a breakpoint to not break, but log, instead. This should be quite interesting. Also the option to "go back in time" by dropping a frame from the callstack is very useful. This way, it's possible to go over some part of the execution again without having to restart the whole application.