Bismillah Hir Rahmaan Nir Raheem
As Salaamu 3laykum,
I hope you are doing well. With regards to your question, we first have to understand that this earth has been made a place of prostration so that any place can be a masjid/mosque geographically.
"The Messenger of ALLAAH (peace be upon him) said: 'The earth has been made for me a place of prostration and a means of purification, so wherever a man of my Ummah is when the time for prayer comes, let him pray.'" (Nasai in the chapter of masjids)
So a masjid can be made anywhere on Earth. Now coming to the question to how to make the masjid. A masjid is a place dedicated for praying and any place can be made into a masjid as long as its dedicated as a masjid. Of course clean out the place and make it clean as possible suitable for prayer.
Here is the evidence that a disbelievers place of worship can be converted to a masjid/mosque:
From Talq ibn ‘Ali (may ALLAAH be pleased with him): “We went out as a delegation to the Prophet (peace and blessings of ALLAAH be upon him). We gave bay’ah (oath of allegiance) to him and prayed with him. We told him that in our land we had a place of worship [the word used indicates a jewish or christian place of worship], and we asked him to give us some of the water left over from his wudoo’, so he called for water and did wudoo’ and rinsed out his mouth, then he poured that water into a vessel and told us, ‘Go, and when you reach your land, knock down that place of worship and sprinkle this water over the place, then use that place as a mosque.’ We said, ‘Our land is far away and the heat is intense, the water will dry up.’ He said, ‘Add more water to it, it will only increase it in goodness.’ So we set out and when we reached our land, we knocked down our place of worship, sprinkled water on the place and used it as a mosque. We called the adhaan there, and when the monk, a man from Tayyi’, heard it, he said, ‘The call of truth!’ then he climbed one of our hills and we never saw him again.” (Reported by al-Nasaa’i, 694).
The following ahadith I use to show that the any place can be used as as masjid as long as the primary purpose is for the establishment of five daily prayers and it secondary purposes is for religious purposes.
"The Messenger of ALLAAH (peace be upon him) said: 'Spitting in the Masjid is a sin, and its expiation is to bury it.'" (Nasai in the chapter of masjids)
It was narrated from 'Amr bin Shu'aib, from his father, from his grandfather, that the Prophet (peace be upon him) forbade sitting in circles on Friday before Jumu'ah prayer, and buying and selling in the Masjid. (Nasai in the chapter of masjids)
"A man came making announcement of a lost camel in the Masjid, and the Messenger of ALLAAH (peace be upon him) said: 'May you never find it!'" (Nasai in the chapter of masjids)
Have a nice day!