How do you test a crankshaft position sensor on a 1997 Chevrolet cavalier 2.4L?

that would come up on your on board computer, test it with a obd2 scanner an trouble codes will come up, if your car still runs they will test it free at auto-zone or murrays