BEGINNERS: Troubleshooting your project

I have spent half my life tracking down coding errors and syntax errors.
If I am compiling and I get an error in a certain function and can't for the life of me understand what the error message is on about, I select all the code lines in the function and then comment out the lines. I then uncomment a few lines or a block, and then try a compile. It that compile goes well I then continue uncommenting lines and blocks and trying a compile again, and so on. Eventually I will uncomment a line, or block, and the compiler will fail. This narrows things down for me

Steve