When trying to fix a bug, we need to first become aware that there is a bug in the program. At this stage we need to identify the point in which the bug occurred. Did it occur during development? During testing our software? During production?
Once we know where the bug is located, we need to fix the code where the bug occurred. We take a logical approach and replace the error code with the corrent solution.
Finally, when the code is fixed, we need to make sure the same error does not occur again. Once the problem is solved, we run a diagnosis within the entire codebase and search for any similar code in case there is a similar bug. This can be done easier by using testing softwares.