To the code - that's pretty obvious: if the bug is in the code one has at first locate it precisely and analyse its context. After that one could google, use stackoverflow or chatGPT or fix it directly right away. You are welcome.