You never avoid debugging. Unit tests help you avoid having to use a debugger and painfully stepping through your code. They do this because they can help isolate problems down to individual classes and methods.
Of course, unit tests don't help in that way much if you write huge, bloated, do-everything classes that follow a poor object design. So you still have the onus to design discrete, well-encapsulated classes. But if you do so, it becomes a lot easier to quickly find broken parts and fix them.