In the Name of God, the Merciful, the Compassionate.
There is a narration which says: “The hand of the Sufyan, one of the prominent figures of the end of time, will be pierced.”
Thus, this Hadith infers that the Sufyan will bind people to himself by encouraging them to be wasteful. And by arousing in them an intense greed and ambition, he will hold them in subjection through that weak vein of character. It predicts that the extravagant will become captive to him, and fall into his trap.
God knows what is right, this may be interpreted as follows: the Sufyan will wear the headgear of non-believers, and make everyone else wear it. However, since it will be generally adopted under compulsion and the force of the law, when that headgear is taken into prostration [in worship], it will become rightly-guided, God willing, so that those who wear it —unwillingly— will not become unbelievers.
Bukhari, Fitan, 26; Muslim, Fitan, 101, 102; Tirmidhi, Fitan, 62; Musnad, iii, 115, 211, 228, 249, 250; v, 38, 404-5; vi, 139-40.