I think @xxxx got it right. Remember the sequence from Vitakkasanthana Sutta:
"There is the case where evil, unskillful thoughts — imbued with desire, aversion, or delusion — arise in a monk while he is referring to and attending to a particular theme. He should attend to another theme, apart from that one, connected with what is skillful.
...
"If evil, unskillful thoughts — imbued with desire, aversion, or delusion — still arise in the monk while he is attending to this other theme, connected with what is skillful, he should scrutinize the drawbacks of those thoughts: 'Truly, these thoughts of mine are unskillful, these thoughts of mine are blameworthy, these thoughts of mine result in stress.'
...
"If evil, unskillful thoughts — imbued with desire, aversion or delusion — still arise in the monk while he is scrutinizing the drawbacks of those thoughts, he should pay no mind and pay no attention to those thoughts.
...
"If evil, unskillful thoughts — imbued with desire, aversion or delusion — still arise in the monk while he is paying no mind and paying no attention to those thoughts, he should attend to the relaxing of thought-fabrication with regard to those thoughts.
...
"If evil, unskillful thoughts — imbued with desire, aversion or delusion — still arise in the monk while he is attending to the relaxing of thought-fabrication with regard to those thoughts, then — with his teeth clenched and his tongue pressed against the roof of his mouth — he should beat down, constrain, and crush his mind with his awareness. As — with his teeth clenched and his tongue pressed against the roof of his mouth — he is beating down, constraining, and crushing his mind with his awareness, those evil, unskillful thoughts are abandoned and subside.
...
"Now when a monk... [using one of these methods] steadies his mind right within, settles it, unifies it and concentrates it: He is then called a monk with mastery over the ways of thought sequences. He thinks whatever thought he wants to, and doesn't think whatever thought he doesn't. He has severed craving, thrown off the fetters, and — through the right penetration of conceit — has made an end of suffering and stress."
This is part of the large scheme with abandoning negative mind states and developing positive ones:
"There is the case where a monk generates desire, endeavors, activates persistence, upholds & exerts his intent for:
- non-arising of evil, unskillful qualities that have not yet arisen.
- ... abandonment of evil, unskillful qualities that have arisen.
- ... arising of skillful qualities that have not yet arisen.
- ... maintenance, non-confusion, increase, plenitude, development, & culmination of skillful qualities that have arisen."
And the way the positive qualities are generated in the first Jhana is with intentional vitakka and vicāra, or deliberate thinking/generation/enjoyment, about how well you mastered the non-arising and abandonment of "evil, unskillful qualities":
Suppose a skilled bath attendant or his apprentice were to pour soap flakes into a metal basin, sprinkle them with water and knead them into a ball, so that the ball of soap flakes would be pervaded by moisture, encompassed by moisture, suffused by moisture inside and out and yet would not trickle. In the same way, one drenches, steeps, saturates, and suffuses one’s body with the rapture and happiness born of seclusion, so that there is no part of one’s body that is not suffused by rapture and happiness.
Makes sense? It's nothing magical. First you learn to abandon negative mind states, either through suppression or through distraction, and eventually through direct control of the emotional center that colors the process of free association -- and then you learn to generate positive mind states, first through deliberate thinking, and then directly. That's Jhanas in a nutshell.