"Bad thoughts" is a relative term that first must be defined before we seek to somehow overcome or suppress them. After all, what might be a bad thought to a Mother Theresa type would be vastly different than to say, a drug dealer or psychopath. In the latter cases, thoughts of "I hope I don't get caught" or "what happened to my shipment of heroin, it's late" would qualify as negative. Of course, for the majority of us, bad thoughts would be those which are destructive, either to self or others, so for this purposes of this article we will make this normalizing assumption.
There are two predominant systems of therapy for the elimination of negative thinking. The method that was in vogue until the last few decades was the psychoanalytic approach made famous by Sigmund Freud. This involved an attempt to find the source of the initial trauma or event that led to the pattern of negative thinking. This focus was purported to lead to a sort of catharsis that would free the patient from the cycle of negative thoughts. We are all familiar with the caricature of the pipe-smoking analyst asking the prone patient to "tell me about your mother".
Much of Freud's contribution has been repudiated in recent times in favor of a more holistic approach that recognizes the relativity of human experience. In this model, termed "client-centered" therapy, professionals seek to understand the unique circumstances of their client's negative thought patterns, attempt to achieve a therapeutic rapport, and then suggest positive alternatives to literally "drown out" the bad thoughts. A helpful analogy would be a lawn that has weeds growing in it. Though the weeds could in theory be removed, there would be a great cost in labor to take out the individual unwanted plants, or in overall damage to the lawn by the use of chemicals. The preferred method is of course to fertilize the desired grasses so that in time they will crowd out the weeds in competition for sunlight, and the weeds will die a natural death as a result.
Given the two approaches, it is clear that the client-centered model is of much greater value and does far less harm than the Freudian obsession with the negative thought patterns themselves. It is a sort of folk psychology - stop paying attention to what bothers you, and those conditions will disappear on their own. While cases of mental illness are obviously outside the scope of this discussion and would need more significant intervention, for most people the nagging of negative thinking could be successfully addressed in this manner. At the least, it's worth a try as a no-cost, no bad outcome approach.