Organic material (plants and animals) contains carbon.
Carbon has three main isotopes: carbon 12, 13 and 14. Carbon 14 is radioactive, with a half life of 5730 years.
Carbon 14 is continuously created in the atmosphere by cosmic rays hitting nitrogen. The nitrogen atoms lose a proton when struck by cosmic rays, turning the affected nitrogen atom into an atom of carbon.
The carbon 14 then reacts with oxygen in the atmosphere to create carbon dioxide. Plants taken in the radioactive carbon dioxide along with non radioactive carbon dioxide. Plant eating animals take in the radioactive carbon when they eat plants and meat eating animals take in radioactive carbon when they eat other animals.
When a plant or animal dies it stops exchanging carbon with the environment and it dies with a certain amount of radioactive carbon 14.
By measuring how much carbon 14 is contained in a specimen and knowing the half life of carbon 14, scientists can calculate when an animal died.
Due to the half life of carbon 14 being 5730 years, carbon 14 dating can only reliably be used for dates up to 50 000 years old.
More details about carbon 14 dating can be found here.