Do you mean the Speedometer - The Rear Left hand side ABS wheel speed sensor also drives the speeometer.
If you mean wheel speed sensors then these are retained in the hub with one bolt.
Remove bolt
Remove sensor - Follow the wire to where it is located
Replace sensor.
Inspect ABS reluctor ring through speed sensor hole to make sure it is clean and not broken
If you need to replace this then visit peilcan parts for instructions.
Here ;
https://www.pelicanparts.com/techarticles/BMW_Z4M/83-BRAKES-ABS_Wheel_Speed_Sensor_Replacement/83-BRAKES-ABS_Wheel_Speed_Sensor_Replacement.htm