sankalpaprabhavaankaamaanstyaktvaa sarvaanasheshataha |
manasaivendriyagraamam viniyamya samantataha || 24 ||

Totally discarding all desires born out of thought projections, withdrawing the mind from sense objects everywhere.
sankalpa : thought projections
prabhavaan : born from
kaamaan : desires
tyaktvaa : discarding
sarvaan : all
asheshataha : totally
manasaa : mind
indriyagraamam : sense objects
viniyamya : withdrawing
samantataha : everywhere
In this and the next shloka, Shri Krishna gives us a method for dealing with one of the biggest challenges in meditation : uncontrolled desires. He says that in order to fulfill the goal of keeping the mind established in the self, we have to completely withdraw the mind from all sense objects and tackle desires at their root.
As we have seen in the “ladder of fall” in the second chapter, a thought is born as soon as we begin brooding or daydreaming over an object, person or situation towards which we have raaga (attraction) or dvesha (hatred). The more time we spend brooding on the object, the more force is gathered by the thought, just like a snowball gathering momentum.
It is this brooding over objects that we like or hate that has to be checked. Only this restraint will stop desires in their tracks. But to pull this off, we have to follow a multi-pronged approach. First, we have to be aware of our thinking process so that we can stop the brooding the instant it starts. It is just like stopping any phone calls or outside interference when we are in an important meeting. Next, we have to apply this technique to all types of brooding or daydreaming, not just to objects we hate. Finally, we have to constantly examine our likes and dislikes so that we can develop dispassion towards them.
Foremost around “desire-generators” are sense objects. Our sense organs are programmed to rush towards objects that they like, and rush away from things that they dislike. While they rush, they drag our mind along, causing distraction and agitation. That is why it is advised to meditate in a clean and quiet place so that the sense organs cannot come into contact with anything and distract us. Gradually, as we get more proficient in meditation, we should ensure that the sense organs do not take in strong impressions that can pop up later in meditation. For example, if we love oranges, then we should be careful not to eat an orange just before meditation, otherwise the mind will keep thinking about the orange.
Now, once the mind has been withdrawn from the senses, it will seek an outlet for the outward force that used to rush out towards sense objects. If this force is not provided with a suitable outlet, we will get into trouble. So what should we do with all the latent energy that is stored up? Shri Krishna discusses this point in the next shloka.