As to illusory thoughts...
As to illusory thoughts, preoccupation with them lies in reflecting on insignificant matters, or devoting oneself to some non-beneficial science or anything preoccupation with which keeps one from one's desired goal. Khalwah means the avoidance of all these obstacles.
Hence one seeking khalwah should try to be free of inward and outward sensory preoccupations and to discipline his animal faculties, so that they don't divert him toward things which, being compatible with these faculties, prompt him to avoid that which is not attuned to them. He should refrain totally from illusory thoughts, which are thoughts whose goal is attainment of good things of the life of the world and the Hereafter.
The good things of worldly life are ephemeral, and as to the goods of the Hereafter, their goal is the attainment of lasting pleasures for the ego seeking them. After removing the outer obstacles and freeing the inner self from preoccupation with anything other than Allah, one should direct all his concern and his undivided intention to being watchful over the happenings of the Unseen' (sawanih ghaybi) and being vigilant over real intuitions (waridat-e haqiqi).
That is called contemplation (tafakkur), which shall be dealt with in a separate section which follows. Section Two: On Contemplation God, the Exalted and the Glorious, says: Haven't they pondered within themselves? God created not the heavens and the earth, and that which is between them, except with the Truth ... ?
(30:8) Although many meanings have been ascribed to [the term] tafakkur, their essence is that contemplation is an inward journey of humanity from the preliminaries (mabadi) to the goals (maqasid). The same sense is ascribed to nazar in the terminology of scholars. None can make the transition from deficiency to perfection without undertaking this journey, and hence it has been said that the most essential of obligations is contemplation and thought.
The instances of encouragement given to contemplation in the [Qur'anic] Revelation are countless: And in that are signs for a people who think. (13:3) And it has been stated in hadith: An hour's contemplation is better than seventy years of worship. 15 One should know that the starting point from where this journey should commence are 'the horizons and the souls' (afaqq wa anfus; 41:53). It is a rational journey (sayr-e istidlali: lit.
'evidence-seeking journey') guided by the signs (ayat) pertaining to each of the two.