Micah 5:2

“But as for you, Bethlehem Ephrathah, too small to be in the families of Judah. From you one will go forth for Me to be ruler in Israel. His goings forth are from long ago, From the days of eternity.”

ואתה בית-לחם אפרתה
Here, Bethlehem and Ephratah are synonymous. This is shown in Ruth 4:11: “... may you [בעז] achieve wealth in Ephrathah and become famous in Bethlehem.”

Both Genesis 35:19 and
Genesis 48:7 show conclusively that Ephratah and Bethlehem are references to the same place: "Ephratah (אפרתה) which is Bethlehem" [בית-לחם הוא] and "Ephrath (אפרת) which is Bethlehem" (בית-לחם הוא).

Genesis 35:16 suggests that Ephrath was the original name of Bethlehem, “Then they journeyed from Bethel; and when there was still some distance to go to Ephrath, Rachel began to give birth and she suffered severe labor.”

To be an Ephrati was to be from Bethlehem. Compare: “Now David was the son of the Ephrati of Bethlehem in Judah, whose name was Jesse...” (1 Samuel 17:12). Jesse was an Ephrati man, of Bethlehem.
So what we read in Micah is this: "You (אַתָּ֞ה = Masc.) Beth Lechem (Masc.) Ephratah (Fem.)... From you (ממך  = Masc) for me will go out..."
Bethlehem is being addressed.
צציר להיות באלפי יהידה
"...being small (literally: small to be) among the families of Judah..."
It is the Ephrati families of Bethlehem who are insignificant in Judah. David was viewed as small and insignificant (1 Samuel 16:11) from a family of Bethlehem (1 Samuel 16:18). Again, it is clear from the association the referent (ממך = you) is the place Bethlehem.
ממך לי יצא להיות מושל בישראל
"From you will come/go out for me (one) to be ruler in Israel..."
'From you', that is, Bethlehem. '...will emerge, come out/go out (יֵצֵ֔א)'. '... a ruler (מושל- king by definition). This king goes out in the name of יהוה and will rule in Israel. The messianic implication is obvious: the Messiah will come from Bethlehem!
ומוצאתיו מקדם מימי עולם
'...and his origins/appearances (מוצאה lit. goings out) are from the past (מקדם  lit. from before/east), from ancient times (מימי עולם - days of eternity, ancient days).'

So this ruler had made appearances, done things, gone forth, throughout the history of Israel and the Patriarchs. This one who emerges from Bethlehem is no new kid on the block but one who had been around and made numerous appearances to the people. The language relates to the divine and yet this ruler has appeared and acted on many occasions reaching back into the mists of time and eternity. There is a candidate who fits the bill in Tanakh - Malakh Yahweh, the visible, bodily manifestion of יהוה, the God of Israel!