Shulchan Arukh, Orach Chayim Siman 136
Can copy this into an AI, or connect the whole library to your assistant. For deeper learning, you can directly use the original seforim, sites, and apps.
בשבת וי"ט ויוה"כ קורים אחר לוי ת"ח הממונין על הצבור ואחריהם ת"ח הראוים למנותם פרנסים על הצבור [ששואלים אותו דבר הלכה בכל מקום ואומר] ואח"כ בני ת"ח שאבותיהם ממונים על הצבור ואח"כ ראשי כנסיות וכל העם:
On Shabbos, Yom Tov, and Yom Kippur, after the Levi we call up Torah scholars who are appointed [as leaders] over the community; and after them, Torah scholars who are fit to be appointed over the community [who can be asked a Halachic (Jewish Law) question in any area of Torah and can respond]; and after them, children of Torah scholars whose fathers are appointed over the community; and after them, the heads of synagogues, and the rest of the people.