Discouragement occurs as a result of prior practice. It has to be eliminated through knowledge, through practice. The feeling of discouragement comes when not just one, but all of our weaknesses culminate. They reside in our subtle body and therefore, from time to time, they become strong and manifest. Just like a strong wind that suddenly comes and passes, in the same way, they also come and go. They are not permanent. During that time (a devotee) should hasten his devotion. Everything will be possible with practice only.
For example, when someone is riding a bike or when someone is driving a car up a hill or a slope, he puts the car in first gear, puts it in second gear and the car easily drives up the hill. One who is riding a bike puts out more effort trying to get up a hill. When the slopy part ends, then the bike runs smoothly. Similarly, due to the old practice of our attachments, our consciousness becomes prone to mistakes. However, with practice it slowly and gradually becomes normal.
Sometimes a piece of stone accidentally appears in the food, but it is picked and thrown out and the person continues eating. Therefore, in the same way, when negative thoughts and ideas arise in the mind, we should understand that our past bad actions are causing a hindrance and that we should eradicate them with our devotional strength. We can conquer the negative thoughts and ideas by heeding the Divine teachings of the scriptures and Guru.