I will go down to see whether they have acted altogether according to the outcry that has reached Me; if not, I will take note.” (18:21)
Chazal teach us that Hashem sent the angels to destroy Sodom. The Ohr Hachaim asks two questions. 1) Why did Hashem need to send angels to punish Sedom? Why couldn't he punish them Himself? 2) Why did the angels need to appear disguised as human beings?
The Ohr Hachaim answers that Hashem was demonstrating his patience and kindness by giving the people of Sedom one last chance. He sent the angels disguised as men to test them as to how they would be treated. If the people of Sedom would be kind to them or at least not harm them, Hashem would relent and not destroy Sedom. If the people of Sedom would fail the test by attempting to harm these angels in disguise, then Hashem would proceed to destroy Sedom. The posuk tells us that Hashem descended to this earth one more time by sending angels disguised as men to administer the final test.