People during that time complained of corruption by Yajuj and Majuj,they requested Dhul-Qarnayn to make a barrier of wall between them to keep them imprisoned.
The barrier was created with iron & copper by Dhul Qarnayn
"They said, O Dhul-Qarnayn, indeed Gog (Yajuj)and Magog (Majuj) are [great] corrupters in the land. So may we assign for you an expenditure that you might make between us and them a barrier?"
(Qur'an: Al-Kahf 18: Verse 94)
They are mentioned in chapter numbers 18 and 21 of the Qurʾān.
The story of Dhul-Qarnayn is all explained in verses : 93-98 of Surah Kahf. Surah kahf is 18th chapter of Qur'an
Yajuj and Majuj are monstrous by nature. They like destroying stuff like crops, trees, buildings and people.
The coming out of Yajuj and Majuj is a major sign of the coming of the Hour. (Tirmidhi 2183)
Until, when Yajuj and Majuj are let loose (from their barrier), and they swiftly swarm from every mound. And the true promise (Day of Resurrection) shall draw near (to fulfillment)…” [Surah al-Anbiyaa:96-97]
“They excavated each day, until when they are just about to penetrate it, their leader says: ‘Go back so that you can penetrate it tomorrow!’