The crankshaft position sensor monitors the rate at which your crankshaft is spinning. Though extremely durable, they can be damaged by high temperature fluids coming from the engine or by road debris damage. Your crankshaft position sensor may be faulty if your check engine light is on and your car is stalling---especially at low speeds---or stalls when you shift gears. Other symptoms include the engine misfiring and acceleration problems.
Plug in your diagnostic scanner and check the fault codes.
Diagnose your problem from the fault code displayed on your diagnostic scanner.
Drive to a local automotive parts store for a less expensive alternative. Most of them have scan testers and will test (for free) your crankshaft position sensor and interpret the code.
A faulty or worn spark plug (or plug wires) can cause the same symptoms so check those first.