Previous verses mentioned the tseachery and ill-will of the hypocrites. The present verses comfort the Holy Prophet (SM) asking him not to grieve over the mischiefs made by the disbelievers for they cannot harm him in any way.
The last verse (178) carries a refutation of the false notion about disbelievers: How can they, while obviously prospering in the present world..be regarded as victims of Allah's wrath and rejection?
Material affluence of disbelievers is, after all, an extension of
Let there be no doubt about the worldly well-being of disbelievers for one may be tempted to believe that since Allah Almighty has given respite, long life, security and comfort to disbelievers so that they go on increasing in their crimes, they should, then, be taken as innocent. Far from it, because the verse means that Muslims should not feel upset about this temporary respite and affluence given to disbelievers as all this worldly wealth and power in their hands despite their disbelief and disobedience is nothing but a form of the very punishment destined for them. Today, they do not realize it. But, once they leave the mortal world, they would. They would discover to their dismay that all those articles of comfort they acquired and spent in sin were, in reality, the very embers of Hell. This is corroborated by several other verses of the QurEn. For instance إِنَّمَا يُرِيدُ اللَّهُ لِيُعَذِّبَهُم بِهَا (Allah intends to punish them with it - 9 5.5) which means that ihe wealth and power of disbelievers and the~rv ulgarly luxurious consumerism should not be a matter of pride for them for this is nothing but an instalment of that very punishment f'rorn Allah which will cause their punishment in the Hereafter to increase.
مَّا كَانَ اللَّهُ لِيَذَرَ الْمُؤْمِنِينَ عَلَىٰ مَا أَنتُمْ عَلَيْهِ حَتَّىٰ يَمِيزَ الْخَبِيثَ مِنَ الطَّيِّبِ ۗ وَمَا كَانَ اللَّهُ لِيُطْلِعَكُمْ عَلَى الْغَيْبِ وَلَـٰكِنَّ اللَّهَ يَجْتَبِي مِن رُّسُلِهِ مَن يَشَاءُ ۖ فَآمِنُوا بِاللَّهِ وَرُسُلِهِ ۚ وَإِن تُؤْمِنُوا وَتَتَّقُوا فَلَكُمْ أَجْرٌ عَظِيمٌ
Allah is not to leave the believers in what you are in unless He separates the impure from the pure. And Allah is not to inform you of the unseen. But Allah selects from His messengers whom He wills. So, believe in Allah and His messengers. And if you believe, and feaxiAllah, then, for you there is a great reward. 
The previous verse (178) answered the question about disbelievers as to why they, being the detested ones in the sight of Allah, are in possession of all sort of wealth, property and other means of luxurious living?
The present verse (179), in sharp contrast, removes the doubt about true believers as to why they, being the favoured servants of Allah, are tested with all sorts of hardships? Being favoured required that they should have been the ones living in comfort surrounded by its paraphernalia !
The wisdom of making a believer distinct from a hypocrite through practical demonstration rather than through a revelation.
It has been said in this verse that Allah Almighty has His way of making a sincere believer distinct from a hypocrite through which He generates such situations of hardship as would expose the hypocrisy of the hypocrites practically. This distinction, though, could also be made by identifying hypocrites by name through a revelation. But, the later course was not taken because it would have not been wise. The whole range of wisdom behind what Allah does is known to Him alone. However, one wise consideration in the present context could be: If Muslims were told about a person being a hypocrite through revelation, they would have had no difficulty in dealing with them carefully, but this would have not provided them with a clearly demonstrated proof necessarily acceptable to the hypocrites for, they would have still insisted: 'You are wrong. We are true Muslims.'