depends, what error you are talking about: Is it a syntax error, then it should be not a problem at all, to fix the error, as you basically get an error description from the ABAP workbench (either syntax check, during compile time or if you use alternatively the code inspector or extended syntax check). All this tools should support you very well in order to find and fix syntax error.
If it is an logical error, then you need to analyze your coding in depth. That means first step would be to think about the program flow in order to narrow down the possible bug and then set some breakpoints in the located codes snippets.
When the debugger stops at the breakpoints, you could then easily check values of variables, structrues, etc. which enables you to find and fix the bug.