Stressing on the importance of what we think, the Dhammapada, a versified Buddhist scripture, ascribed to the Buddha himself, says: "All that we are is the result of what we have thought."
We can check negative thoughts by trying to control adulterous lust, anger, greed and pride that generate such thoughts. What we think about depends to an extent on what we feed our minds on: What we read, what we watch on TV or talk about with our friends and family. It is, therefore, necessary to be selective in these activities.
One has to check useless thinking. Swami Sivananda has said: "Just as energy is wasted in idle talk and gossiping, so also, energy is wasted in entertaining useless thoughts."
Everyone thinks but not everyone develops his ability to think on a subject or about a problem. Swami Sivananda had said: "The common man does not know what deep thinking is. Thinking is very shallow in the vast majority of persons."
The ability to think independently is an asset in research and other intellectual activities and even in our daily lives. One can acquire this ability by getting into the habit of reading and writing on a regular basis. The sciences and maths that we study in school also help us think in abstract. Writing in one's journal, an email, or an article does not involve merely the recording of one's thoughts. It facilitates and promotes thought.
Some people are inclined to take tobacco when they have to do some work that requires thought. Tobacco facilitates the generation of new thoughts but the quality of such thoughts is inferior, according to Leo Tolstoy.
But beware, hard thinking can rob your peace of mind and drive away sleep. Therefore, it is preferable not to read a thought-provoking book at bedtime!