In programming, a "bug" is an error or fault in a program that causes it to behave incorrectly or produce unexpected results. Debugging is the systematic process a programmer follows to locate these bugs and correct them so the program runs as intended.
This process typically involves running the program, observing where it fails or produces wrong output, tracing back through the code to identify the exact line or logic causing the problem, and then correcting that code. Because this process is specifically about finding and removing errors from a program's code, debugging always refers to fixing the software itself, not the physical computer.
Preventing bugs before they occur is a different activity, closer to careful coding practice or testing, rather than debugging itself. Inserting errors into a program is the opposite of debugging. Removing errors from a computer, as opposed to a program, misapplies the term to hardware rather than to the software where bugs actually occur.
Exam reminder: always connect "debugging" specifically to software/programs, since bugs are errors in code, not physical faults in computer hardware.