They said, "Take a mutual oath by Allāh that we will kill him by night, he and his family. Then we will say to his executor, 'We did not witness the destruction of his family, and indeed, we are truthful.'"
The Plot of the Mischief-Makers and the End of the People of Thamud
Allah tells us about the evildoers of Thamud and their leaders who used to call their people to misguidance and disbelief, and to deny Salih. Eventually they killed the she-camel and were about to kill Salih too. They plotted to let him sleep with his family at night, then they would assassinate him and tell his relatives that they knew nothing about what happened to him, and that they were telling the truth because none of them had seen anything. Allah says:
وَكَانَ فِى الْمَدِينَةِ
(And there were in the city) meaning, in the city of Thamud,
We shall attack him (Salih علیہ السلام) and his family at night, then will say to his heir, We did not witness the destruction of his family and we are really truthful - 27:49.
The plan was that all of them together should attack him and his companions in the darkness of night, and kill them all. And when the claimant of the blood would make the claim, they would say that they did not kill him, and also they did not know who had killed him. In saying so they would have uttered the truth because no one could have known who had killed whom in the darkness of the night.
The point to note here is that all the acts of infidelity, disbelief, killing and pillage were being performed by the infidels, rather than those among them who were hardened criminals. Yet they were careful that they don't speak a lie or get blamed for falsehood. This shows how great the sin of falsehood is, that even the perpetrators of heinous crimes avoid it for the sake of their self-respect.
The other thing worth noting in this verse is that the one whom these infidels had mentioned as the Wall or heir of Sayyidna Salili (علیہ السلام) was a man of his own family. So, why did they leave him out from being assassinated? The answer to this question is that he might have been the successor from the lineage point of view, but otherwise he could be an infidel and be a party with the infidels. There could have been the consideration that he might claim the compensation for the blood of Sayyidna Salih (علیہ السلام) because of his relationship with him. The other possibility is that he might have been a Muslim but enjoyed a prominent position and hence there could have been the risk of uprising and reprisal among the people. Only Allah knows best.
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 47–51
When Salih started calling for belief in the pure unity of God, his community divided itself into two groups. The leaders of the community were too wrapped up in their own greatness to accept the pure and unadulterated religion preached by Salih. But, among the less important people, there were some who gave a positive response to his call. The two groups began having controversial discussions. The leading luminaries of the community stated quite bluntly that they did not believe in God and that He might bring upon them whatever retribution He wanted as a punishment for their denial. If they faced any hardship, they were wont to say that it was the ill-luck brought upon them by the inauspicious presence in their midst of Salih and his companions. All these things were said in order to humiliate Salih and belittle his call, and not as a result of any serious thought. Their circumstances, whether good or bad, had come to them from God. But they took advantage of good circumstances to feed their false pride and cited bad circumstances to make false complaints. The rising of a prophet from among them was in the nature of a trial devised for them by God. They were placed in this position in order to see whether they recognised the Truth and co-operated with it, or whether they remained blind and deaf towards it. They failed in this trial. They were so preoccupied with material things that they failed to comprehend the reality.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.