What is bug/lag in Development and how can I fix it?

Hello there!
I have a question.
I always wanted to know what bugs are.
So, my questions are:

  • What are bugs in development?
  • How can they be avoided?
  • If they occur, how can they be fixed?

Bugs are basically errors or mistakes in your code, or maybe something that has unintended behavior. Thats basically it in simple terms.

Well Debugging script solve bugs?
Because I once scripted a gun. There was no issues in output.
But there was a bug.

Well, yea. Debugging a script is literally removing bugs. To debug you literally find the problem and fix it.

Thank you for helpful information about bugs.