When you have people around that want to learn things and come up to you with questions, it is easy to give them a straight up answer. Especially when you’re busy: you have the experience and by doing it the way you’ve done it before, they have the biggest chance of succeeding. And also, it feels great. I’m proposing a more effective way.
Next time, try to respond with “how would you do it?”. There are two routes. The first one would be to listen to the proposed way to go and let him or her continue as they suggested if you feel there are no huge things at stake (or no completely unfixable things). Just don’t share your approach though, this is about the process, not about what you think is best.
The second approach is even scarier: you ask the same question. As soon as the other person starts talking about the solution, you interrupt and say “do that!”. It is scary because you hand over control. It also shows your trust in the other person and that you are willing to give them space to do things their way.