What I’ve been taught is to let the child try, so long as it isn’t frustrating them unduly. As with any skill, language recall comes with practice, and shortcutting that is not helpful. However, if it is frustrating the child, help is appropriate, as otherwise the child will simply avoid the interaction.
What I usually do in similar situations with my children (not speech, as my children are older, but age-similar) is to let them try until they either ask for help or clearly are beginning to be frustrated. When that happens, if I can, I try to guide their recall/process; in particular my youngest often needs a reminder simply to keep going:
You were asking me if I liked something?
If he does forget what he was talking about, then you can ask if he needs help, but it may be sufficient just to refocus him.
Either way don’t automatically correct him if he’s doing okay and just needs more time. That is common at that age, and helping him doesn’t help in the long run with either language or self sufficiency, unless he has a real language issue (in which case you should be asking a doctor.). And even if you don’t think it’s a real issue, do bring this up at your next pediatrician appointment if not earlier to rule out any issues.