Where do the data come from?
Modern observations mostly come from weather stations, weather balloons, radars, ships and buoys, and satellites. A surprisingly large number of U.S. measurements are still made by volunteer weather watchers. There are more than 8,700 citizen observers in the National Weather Service's Cooperative Observer Program who log daily weather data. On the oceans, moored and drifting buoys have begun to replace ships in recent decades as the primary method for measuring temperatures at sea.
The U.S. organization responsible for preserving the global climate record is the National Climatic Data Center (NCDC) of the National Oceanographic and Atmospheric Administration (NOAA). Other nations also maintain archives of global weather and climate observations.
Can scientists use the data as is?
No. To understand why not, imagine you're a nurse checking a patient's chart. You find the following temperature readings (Fahrenheit) for the last few hours: 99.2, 99.8, 1000, 101.4. You'd know immediately that the third number was a mistake. To make a realistic assessment of the patient's condition, you'd have to either adjust it or throw it out.
Weather observers are as human as nurses, and they also make occasional mistakes in recording and transcribing their observations: impossibly high highs and low lows, the exact same temperatures for two months in a row, etc. The first step in data processing is quality control: identifying and eliminating erroneous data.