The coolant temperature sensor allows a vehicle to get data on the coolant temperature so that it can be displayed to the driver and/or taken into account by the ECU.
The typical sensor shell is made out of brass due to its good conductivity and being a semi-soft metal. The sensor itself is typically a variable resistor that adjusts based on heat, also known as a thermistor.
The wiring connection usually has two contacts on it, and a guide in the plastic so it can't be plugged into backwards. Some only have one contact, which means that the sensor's metal shell is the ground/negative.
Coolant temperatures differ based on where the coolant is. Because of this, the best place to get the temperature from is as it is just coming out of the engine, usually near the thermostat.