The children of the forest were the first inhabitants of Westeros and they worshiped the Old Gods. These were the ancient spirits of the forest which were given form in the sacred weir wood trees, which the children gave faces to and through which green seers could see throughout the lands.
The First Men arrived in Westeros crossing over a bridge of land that in those days connected Dorne to Essos. They fought bitterly against the Children of the Forest, but eventually reached a truce. In time the First Men adopted the gods of the children and worshiped at the weir wood heart trees.
When the Andal invaders came to Westeros, they brought with them the worship of the Seven Gods, which became the dominant religion in the lower six kingdoms, but in the north which the Andals never conquered, worship of the Old Gods continued.