(أَمْ حَسِبْتُمْ أَن تُتْرَكُوا…) (Do you think that you will be left [as you are]): The rhetorical question is this here is meant to express negation, in other words, Allah (swt) would not leave you without any trials.
(…وَلَمَّا يَعْلَمِ اللَّهُ الَّذِينَ جَاهَدُوا مِنكُمْ) (while Allah has not yet made evident those among you who strive [for His cause]): Undoubtedly, Allah (swt) knows, and Has a pre-eternal knowledge. However, Allah (swt) does not hold people accountable based on His eternal and complete knowledge; rather, He judges them based on their deeds. Similarly, He says:
أَمْ حَسِبْتُمْ أَن تَدْخُلُوا الْجَنَّةَ وَلَمَّا يَعْلَمِ اللَّهُ الَّذِينَ جَاهَدُوا مِنكُمْ وَيَعْلَمَ الصَّابِرِينَ
(Or do you think that you will enter Paradise while Allah has not yet made evident those of you who fight in His cause and made evident those who are steadfast?) (Al-Imran: 142)
This is the argumentation by which the evidence will be presented against people on the Day of Judgment.
(…وَلَمْ يَتَّخِذُوا مِن دُونِ اللَّهِ وَلَا رَسُولِهِ وَلَا الْمُؤْمِنِينَ وَلِيجَةً…) (And do not take other than Allah, His Messenger and the believers as intimates?): The Arabic word of (intimates) refer to the evil advisors. As there was a close kinship and ties of relationship between the polytheists in Mecca and the Muslims who migrated to Medina. In addition, there was the emergence of hypocrisy in society after several Arab tribes entered Islam, and Islam was strengthened. Therefore, there had to be a test of faith, as humans are subjected to trials, and this is the divine wisdom of Allah in His creation. Here, Allah (swt) wanted to convey to them: “Beware of assuming that you would be left without being tested before Allah makes clear the true essence of your faith, which will be an argument against you?
(…وَاللَّهُ خَبِيرٌ بِمَا تَعْمَلُونَ) (And Allah is Acquainted with what you do): For there is no secret hidden from Him (swt) on the earth or in the heavens; He knows all secrets and the unseen.