In most cases, sensors for your automobile will need to be replaced if they fail, but depending on the type of sensor and its location or function, some can be cleaned and reused.
Sensors can come in many types and are used for a variety of systems on modern cars. We have sensors that communicate engine parameters, like coolant temperature, engine RPM, Oxygen in the exhaust, throttle position, engine speed by crankshaft rotation, and engine load via a MAP (manifold absolute pressure) or amount of airflow entering the engine MAF (Mass AIr flow sensor). MAF sensors have three different types starting with the vane air flow, the hot wire MAF and a Karman-Vortex MAF. We have sensors that caution us for blind spots or help us to park.
There are a host of sensors for the transmission which feedback information on road speed, and the internal parts of the transmission allowing a TCM (transmission control module) to select the proper gear at the proper time. Wheel speed sensors are used for ABS (antilock brake systems) and TPMS (tire pressure monitor systems) to keep an eye on the actual tire pressure and a torque sensor for steering assist and center for systems that add vehicle stability or VSC along with yaw rate and lateral acceleration sensors. AC pressure sensors control the operation of the AC system and the cooling fans and protect the system when the refrigerant charge is either too low, or the system pressure gets too high.
All of these sensors have one thing in common: they communicate to their respective computer or ECU (electronic control module) using electrical inputs. Some sensors use a change in their resistance to affect this input while others use magnetism to produce a small AC electrical output. Still others, like the knock sensor, report using a piezoelectric, sensor which generates its output based on pressure.
Sensors that are magnetic can sometime collect small particles of metal and cause a false signal. These sensors are very sensitive to the air gap between them and the tone ring or toothed gear which triggers the electrical reaction.
In most cases, there is little to clean and reuse as when a sensor goes out of calibration from wear or mechanical damage, or fails due to heat damage, the only repair is to replace them. In the case of a rain sensing sensor or a solar sun load sensor for the AC or perhaps a sensor for blind spot or curb detection, it is possible for them to get dirt or snow in bad weather covering them which could be cleaned.
Since the computers that rely on these signals treat all inputs as valid, when a sensor is faulty, replacement is usually the best option. Have the respective sensor checked by a professional to determine whether it can be cleaned or needs to be replaced.