A good place to start debugging is to track the value of your variables.
You may find that variables don't hold the values you expect, or don't hold any value at all.
An important concept to which your code should adhere is the Single Responsibility Principle.
Each class and method should have a single responsibility, and should call on other classes or methods as necessary to achieve additional functionality.
See if anyone around you has experienced and solved the problem you face, and ask not what the solution is, but how you can solve the problem on your own.
If your neighbors also wind up stumped, and a thorough search on the internet turns up nothing, it's time to ask an instructor.Add as many logs as you like, as they are free to use and provide a means to search through the flow of data within your program while and after it runs.Add in breakpoints to watch as variables in your code are declared, instantiated, assigned values, or altered.Try to apply this priciple at each scope of your code.Ensure every variable, function, class, or other element you name is clearly descriptive of what it holds, returns, or does.Coding is the process of identifying and solving problems.The intent of this document is to serve as a high-level reference for diving into a complex problem, as well as mitigating against, identifying, and squashing bugs.Use documentation to understand the capabilities, properties, and characteristics of the elements of your code.If you're not sure what something can do, or how to interact with or implement a piece of code, dig into the documentation.Don't spend more than an hour trying to solve a problem on your own.After you've exhausted online resources, talk to your neighbors.