How do you replace a crank sensor?

remove the plug unscrew the bolts and put back the way you remove it .

Depending on what car you have, the crank angle sensor is normally located behind your harmonic balancer, or somewhere close to the crank. To remove the harmonic balancer you'll first need to remove the drive belt then remove the bolts holding on the harmonic balancer. It won't usually come off easily so it'll need some persuasion with a few light taps from a hammer, or in severe cases a bearing puller. Once the balancer is removed access to the crank angle sensor is very easy. All you need to do is interchange the busted sensor for a new one.