Check this first
If it stalls or won't restart when hot, this sensor is usually why.
What usually fixes it
In the order a good shop checks them. Typical total: $119–$355 at $130 an hour.
Crankshaft position sensor
$134–$322They fail when hot and leave you stranded.
Wiring or connector
$140–$315Chafed wiring near the engine gives the same symptoms.
Code titles are the generic SAE definitions. Prices are typical US parts and labor for a common car or light truck – a guide for judging a quote, not a quote. Always confirm a repair against the vehicle in front of you.