Firstly, spend at least some time trying to solve the problem yourself.
Some strategies you can try include:
- reread the assignment description, check for any advice or specific recommendations
- rewatch the relevant portion of the class video to see if you missed something
- check your code line-by-line for errors such as mismatched brackets, misspelled variable names, etc
- if you have an error, try googling the error message
- look for results on Stack Overflow (make sure the answer you're looking at is well-rated)
When something in your code that previously worked stops working:
- check whether stashing your changes or reverting to a previous commit fixes it
- if yes, try reapplying your stashed changes line-by-line
- comment out as much code as you can, and then put it back in section by section
- add lots of console logs!
- try using the debugger in your editor or in the devtools
A good question includes:
- what is your goal, what task are you trying to accomplish
- what have you tried, and what did you expect
- what unexpected thing happened instead
- copy and paste any error messages you encountered
- if it's a terminal error, include the command that generated the error
- what resources did you consult
- link to any relevant documentation
- link to, or quote from, any class notes or videos you referred to