Egyptian astronomy divided the year into thirty-six decans, each a ten-day period marked by the heliacal rising of a particular star or group of stars, with five epagomenal days added to complete the year. Decan lists appear on coffin lids from the Middle Kingdom onward, where they served as star clocks for the hours of the night. Thirty-six decans of ten degrees each also fill the 360-degree circle exactly, which is why the scheme survived the transition into Hellenistic astrology as a division of the zodiac, three decans to each of the twelve signs. From there it passed into medieval Arabic and Latin astrology and into the Renaissance image-magic tradition, and it is the ancestor of the decan attributions found in modern tarot correspondences.
Jewish tradition gives a quite separate thirty-six. The Lamed Vav Tzadikim, the thirty-six hidden righteous ones, are said to be present in every generation, unknown to others and often to themselves, and the world is said to be sustained for their sake. The idea develops from a statement at Sanhedrin 97b in the Babylonian Talmud that there are not fewer than thirty-six righteous who greet the divine presence in each generation, the number derived by gematria from a word in Isaiah 30:18. The full folkloric elaboration, the hidden saint who lives as a cobbler or water-carrier and is revealed only in crisis, is later, developed extensively in Hasidic storytelling from the eighteenth century.
The two thirty-sixes are unconnected. Writing that treats them as a single ancient tradition is manufacturing a lineage.