And with the people of Thamud who hewed out their dwellings in the rocks of the valley?
Meaning:-
Hewed: chop or cut (something, especially wood) with an ax, pick, or other tool.
Dwellings: residence, home, house, accommodations.