They use a number of bits of data.Historical records of air temperature, sea temperature, CO2 atmospheric levels, ice core studies.
However simply linking increased CO2 to Global warming, does not necessarily mean humans are the ONLY cause. There are many other variables.