Car starts but as soon as I put in gear it stalls. What could be the cause? on 2001 Ford Explorer

Car has been doing this for a while. May take 2 or 3 starts to get going. Then it is fine while driving and can be fine the next couple of times I try starting it.

Asked by for the 2001 Ford Explorer