P0501 code on 2004 Dodge Ram 1500

How do i repair a speed sensor

Asked by for the 2004 Dodge Ram 1500
The output speed sensor is on the upper left of the transmission with DkGrn/Brn and DkGrn/Vio wires. It's attached with a small bolt. There's no repairiing it if it's faulty, you will need to replace it.