التفسير التبليغي
(وَلَقَدْ كُنْتُمْ تَتَمَنَّوْن الْمَوْتَ مِنْ قَبْلِ أَنْ تَلْقَوْهُ فَقَدْ رَأَيْتُمُوهُ وَأَنْتُمْ تَنْظُرُونَ)
This was at the beginning of Islam and when the Muslims were few, so they were forbidden from wishing to meet the enemy.
Fleeting words and fluttering wishes are not what will lead you to Paradise.
Realizing the word (i.e., acting upon it), continuous effort, and patience in suffering – this is the path.
The wish (mentioned here) is the wish to meet (the enemy) and to support the religion with their utmost effort.
What is meant by 'death' here is death in the way of Allah the Almighty, which is martyrdom, and there is no harm in wishing for it.
Let the intention of the one wishing be to attain the honor of the martyrs, and nothing else.
Their wishing for it was like wishing for something whose difficulties they were unaware of.
(وَلَقَدْ كُنْتُمْ تَمَنَّوْنَ الْمَوْتَ) They used to regret what they missed at Badr and wished for a day with the Messenger of Allah (peace be upon him), saying: "We will surely do such and such," then they were defeated on the Day of Uhud and deserved the reproach.
(وَلَقَدْ كُنْتُمْ تَمَنَّوْنَ الْمَوْتَ مِنْ قَبْلِ أَنْ تَلْقَوْهُ) This was addressed to those who did not witness Badr, and they wished to be present at a battle with the Messenger of Allah (peace be upon him) to attain the honor of martyrdom.
They wished for death in the way of Allah, not death in their beds.
In this verse, there is evidence that wishing for martyrdom is not disliked.
(مِنْ قَبْلِ أَنْ تَلْقَوْهُ) meaning: before the Day of Uhud.
(فَقَدْ رَأَيْتُمُوهُ وَأَنْتُمْ تَنْظُرُونَ) So you saw it before your very eyes and in your sight, meaning: close to you.
It was said: (تَنْظُرُونَ) means to ponder and reflect, i.e., while you are contemplating the situation, how it is.
Source: التفسير التبليغي