Before the Arab and Turkish invasion of Egypt and Anatolia respectively what were their ethnic composition in the Byzantine times? What did they look like exactly?
Egypt was largely Egyptian/Coptic. Anatolia was largely Greek with Greco-Persian, Armenian, and other smaller minorities.
Byzantine Egyptians looked like this. I imagine the lower classes probably looked less Greek and more Semitic.
Anatolia has been an ethnic grab-bag throughout history, I don’t think it was dominated by any one ethnic group prior to the Turks.
You should read this short wikipedia article.
In a nutshell the Arabs and Turks did not impact the ethnic makeup of Anatolia or Egypt in a major way. They did add another layer genetic admixture, just like numerous other invaders over the millenia. But by and large the majority of both populations are the result of the mass adoption of, respectively, Arabic and Turkish as their primary languages. Native populations were not eliminated - they were co-opted.
The same can be said for most of Greek-speaking Anatolia prior to the Seljuq eruption. Not only had Anatolia been populated by diverse peoples ( various old “Asiatic” populations as well as other incomers like the Celtic Galatians who penetrated central Anatolia from Europe ) who were weakly Hellenized by the Byzantines ( linguistically at least ), but both the Byzantines and the Ottomans made extensive use of population transfers as a matter of policy. Both states regularly shuffled local populations back and forth between Asia and Europe ( who then generally became Hellenized or Turkified with time ).
Egypt was largely of Khemic (Ancient Egyptian) ethnic stock, with minor admixtures from Cyrene, Nubia, and after Alexander of Greeks.
Anatolia was significantly more complex. To start with, much of the western and southern coast was ethnic Greek – soething that ended only in the early 20th Century. The Phrygians, long believed to be related to the Greeks, lived inland from there.
The ‘Anatolian’ group (the name is a back-formation from the peninsula name, meaning the early inhabitants of what was later called Anatolia), including the Hittites proper, the Hattians, the Luwians, the Cappadocians, and the Lydians and Lycians, occupied the middle of the peninsula, roughly where Ankara and Cappadocia are now. None of their languages survive, but they are thought to be a part of the ancestry of the area’s present inhabitants.
Gauls from western Narbonensis, north of the eastern Pyrenees and along the adjacent coast, migrated to the area tagged Galatia on Biblical maps, just east of Cappadocia. Their ethnic identity survived until comparatively recent times.
A triangular swath in easternmost modern Turkey, extending from modern Armenia to the corner of the Mediterranean north of Antakya, was ethnic Armenian up until the Armenian Genocide (q.v, and note it’s a controversial topic).
The Adyge people and their relatives the Kabardai and Ubykhs formerly occupied the Black Sea coast and mountainous areas inland between modern Georgia and the Gulf of Azov. Some still live in the southeastern part of this area, but there was a major migration across the Black Sea into Anatolia, where they became known by what in the West are called the Circassians. This group became famed for the beauty of their women … and boys.
Persians, Medes, (more) Greeks, and Mongols all invaded, but appear to have left little or no permanent impact. But the Turks were different. They began infiltrating after the Mongol invasions, and rapidly came to control ‘Lesser’ Armenia, Galatia, and Cappadocia. The Osmanli Turks moved west of them, eventually conquering the entire peninsula and much else, from the gates of Vienna to, literally, the shores of Tripoli, and south to Qatar and Mecca.