This can be a number of things as to why your car is shutting off, if your car is fuel injected, the ports may need cleaning or the fuel tank/fuel pump may have debris in it, that clogs the fuel line. It probably would be a good idea to have your car checked by a technician, most times, they can put the car on a machine to tell why it's doing to cause the problem.
What makes a 2004 freestar start good and then a squeaky noise from belt area and then shuts off, I then crank it up and starts. But does not do it all the time.some times it runs good with no problem . Henry
Could be fuel filter if you let it set and it starts back up and runs good for a little bit and them dies again change fuel filter
You probably have a mass air flow sensor problem. This is the number one cause for car stalls and cut offs.
Sounds like it could be fuel starved. A weak fuel pump, clogged filter, or carb or fuel injection problems can cause that. It could also be a vacuum leak or electrical problem. A loose connection can interrupt the spark. Something as simple as your key switch failing. There's really not enough information to go any further, so it sounds like you need a mechanic. Do it before you're stuck somewhere dangerous!
Possible timing belt break.
My daughter has a 2002 Ford Focus and it started stalling while she is driving. We took it to a mechanic and they ran all the diagnostic testing and couldn't find anything wrong. They drove it around and let it run and it wouldn't stall on them. Could it be ice or water in the gas tank? Should we try an additive in the gas tank? Don't know what else to do at this point.
What kind of car is it. Year make model. Tell me that info and I can help you.