"So how will it be when We bring from every nation a witness?" meaning: on the Day of Resurrection, he will bear witness against his people that he had conveyed the message to them.
Muhammad said: The meaning is: So how will their condition be? This is a form of brevity (ikhtisar). "And We bring you, [O Muhammad], against these as a witness. On that Day, those who disbelieved and disobeyed the Messenger"—meaning: they denied him—"would wish that the earth were flattened with them." Qatada said: Meaning: if only they had sunk into it.
﴿فَكَيْفَ إِذَا جِئْنَا مِنْ كُلِّ أمة بِشَهِيد﴾ يَعْنِي: يَوْم الْقِيَامَة يشْهد على قومه؛ أَنه قد بَلغهُمْ.
قَالَ مُحَمَّد: الْمَعْنى: فَكيف تكون حَالهم؟! وَهَذَا من الِاخْتِصَار. ﴿وَجِئْنَا بِكَ عَلَى هَؤُلاءِ شَهِيدًا يَوْمَئِذٍ يَوَدُّ الَّذِينَ كَفَرُوا وَعَصَوُا الرَّسُولَ﴾ أَي: جحدوه ﴿لَو تسوى بهم الأَرْض﴾ قَالَ قَتَادَة: يَعْنِي: لَو ساخوا فِيهَا.