Counting in prehistory was first assisted by using body parts, primarily the fingers.
This is reflected in the etymology of certain number names, such as in the names of ten and hundred in the Proto-Indo-European numerals, both containing the root *dḱ also seen in the word for "finger" (Latin digitus, cognate to English toe).

Counting aids like tally marks become more sophisticated in the Near Eastern Neolithic, developing into various types of proto-writing.
The Cuneiform script develops out of proto-writing associated with keeping track of goods during the Chalcolithic.