Teachers can have a very strong urge to give students answers - but it's important for students to work out as much as they can by themselves:
To give them a greater sense of ownership and achievement in their learning
The more students think about something, the more likely they are to remember it
This is based on a real interaction I had with a student, who had run into an issue and wanted some help with it.
He was trying to get a delete button to appear after each item on the list, and didn't understand why his code wasn't working.
At this point, I think a good teacher train of thought is: 1. Diagnose the misconception 2. Construct a path for the student to realise the misconception 3. Guide them along the path.
I think this easiest way is to see this in action.
I would typically ask them to spend 1-2 minutes thinking about this, and then invite a couple of trainees to share.