Events that will occur before the Day of Resurrection and distinguish the believers from the kaafirs
Question

                What are the tests or trials that may occur before the last day of Judgement which will help distinguish between the Muslims and Kaafirs?.
Praise be to Allah.The Prophet  (peace and blessings of 
    Allaah be upon him) told us of signs that will take place before the Hour begins, which the scholars have categorized as “lesser signs” and 
    “greater signs”. Some of them designated a third category, “intermediate signs”, namely the emergence of the Mahdi. This is one of the minor 
    signs, but during his time some of the major signs will appear. 
The Prophet  (peace and blessings of 
    Allaah be upon him) has told us of some of the things that will distinguish the believers from the kaafirs before the Day of Resurrection. These 
    include: 

    (a)
    The emergence of the Beast.
Allaah says (interpretation of the meaning): 
“And when the Word (of torment) is fulfilled against them, We shall bring out from the earth a 
    beast for them, to speak to them because mankind believed not with certainty in Our Ayaat (Verses of the Qur’aan and Prophet Muhammad)”
[al-Naml 27:82]
Ibn Katheer said: 
This Beast will emerge at the end of time, when people have become corrupt and forsaken the 
    commands of Allaah, and altered the true religion. Then Allaah will bring forth to them a Beast from the earth.” 
Tafseer Ibn Katheer, 
    3/375. 
It was narrated from Abu Umaamah that the 
    Prophet  (peace and blessings of Allaah be upon him) said: “The Beast will emerge and strike the people on their noses, then their numbers 
    [i.e., those who have been marked on the nose] will increase among you until a man will buy a camel, and they will say, ‘Who did you buy it from?’ 
    and he will say, ‘I bought it from one of those with a mark on their noses.’” 
Narrated by Ahmad, 21805. Classed as saheeh 
    by Shaykh al-Albaani in al-Silsilah al-Saheehah, 322. 
What is meant by striking the people on their 
    noses is that it will make marks on their noses, and there will be one mark for believers and another for kaafirs. 
It was narrated from Abu Hurayrah that the Prophet  (peace and blessings of Allaah be upon 
    him) said: “There are three things which, when they emerge, no good will it do to a person to believe then, if he believed not before, nor earned 
    good (by performing deeds of righteousness) through his Faith [cf. al-An’aam 6:158]: the sun rising from the west, the Dajjaal and the Beast of 
    the earth.” 
Narrated by Muslim, 158. 

    (b)
    The followers of the Dajjaal when he emerges.
It was narrated from Anas ibn Maalik that the 
    Messenger of Allaah  (peace and blessings of Allaah be upon him) said: “Seventy thousand of the Jews of Isbahaan wearing large cloaks will 
    follow the Dajjaal.” 

    (c)
    Madeenah will be cleansed of kaafirs and hypocrites at the time of the Dajjaal.
It was narrated from Anas ibn Maalik (may 
    Allaah be pleased with him) that the Prophet  (peace and blessings of Allaah be upon him) said: “There is no city that the Dajjaal will not 
    enter, except Makkah and Madeenah. He will not approach any of their alleyways but there will be angels standing guarding it. Then Madeenah will 
    be shaken with its people three times, and Allaah will bring forth every kaafir and hypocrite.” 
Narrated by al-Bukhaari, 1782; Muslim, 2943. 

    (d)
    A wind blowing from the direction of Yemen 
It was narrated that Abu Hurayrah said: The 
    Messenger of Allaah  (peace and blessings of Allaah be upon him) said: “Allaah will send a wind from Yemen, softer than silk, and it will not 
    leave anyone in whose heart is faith the weight of a grain but it will take him (his soul).” 
Narrated by Muslim, 117. 
Al-Nawawi said: 
With regard to the meaning of this hadeeth, 
    there are many similar ahaadeeth, for example: “the Hour will not begin until it is not said on earth, ‘Allaah, Allaah’”; and “It will not come 
    upon anyone who says, ‘Allaah, Allaah’”; and “It will only come upon the most evil of people.” All of these and similar reports mean what they 
    appear to mean. With regard to the other hadeeth, “A group of my ummah will continue to follow the truth [?] until the Day of Resurrection,” this 
    does not contradict the other ahaadeeth, because what this means is that they will continue to adhere to the truth until their are taken by that 
    gentle wind, close to the time of the Hour or when its portents appear. So the mention in this hadeeth of them remaining until the Hour begins is 
    to be understood as referring to when its portents appear and it is about to begin. And Allaah knows best. 
Sharh Muslim, 
    2/132. 
And Allaah knows best.