Trouble starting 1996 Dodge Dakota after it runs a while

problems starting my after it has ran for awhile shut it off , then won’t start the starter turns but no run

After 24 years you probably need a tune-up. I would start with the fuel delivery system…injectors,fuel pump etc then move on to the charging system…battery,starter,alternator etc and see how it goes.There are so many things that can prevent a car from starting that I would spend the money and get a pro look at it.

It would suspect a heat-impaired electronic component in the ignition system. If you have a distributor, the thing in there - could be called pickup coil, signal generator, or something else. If you have a CPS (crankshaft position sensor), that’s the suspect. The part, whatever it’s called or wherever it’s located, tells the spark plugs when to fire. You’ll have a no-start, no-spark condition until it cools off.

The problem might be vapor lock

Carry a bottle of water in the truck.

The next time the engine won’t start, open the hood and pour the water over the fuel rails.

If the engine starts, that’s vapor lock.

Tester

If it is vapor lock, it could be a weak fuel pump or a leaking injector.

Without hands on and wild guessing I might take a stab at a faulty ASD relay.