Psychoactive compounds are an effective means to alleviate negative thoughts and feelings. Having said that, I must stress they are not a long-term solution, and can often end up contributing to stress rather than minimising it. In regards to your actual question, what is the best drug to numb depression and stop thinking about the past, the answer is quite complex.
Some drugs can actually help you to stop thinking about the past and your depression, while others work by changing your interpretation of those thoughts. So while you reflect on the past and your underlying depression, there is minimal emotional discomfort. I've found the best drug(s) for this are opiates, alcohol and benzodiazepines (not all at once, obviously!). Being depressants, they slow down the central nervous system (CNS), which enables the user to view the dark thoughts from a distance, reflect more objectively, and allow positive and constructive thoughts/feelings/emotions to surface and be enjoyed. Personally, I prefer morphine and oxazepam to achieve this. Always be careful, know your tolerance levels and NEVER try anything new without a trusted person near-by to ensure you get medical treatment should something go wrong.
As for trying to actually stop these thoughts, logic would dictate that to be near-impossible. Counselling by a social worker, psychologist or psychiatrist can be a great help, especially if they use cognitive behaviour therapy (CBT). There are psychoactive drugs which can do a pretty remarkable job of numbing depression and blocking negative thoughts, although I can't stress enough that these thoughts will always be lurking in the shadows of your psyche. It's really a matter of how well you can cope with them, and striving to minimise the frequency and severity of these unwanted emotions. In regards to what actual drugs can be used for this, I have found amphetamines, or amphetamine-type substances (ATS), are quite effective in 'blocking' dark thoughts. You can go for hours, even days, without dwelling on the shit which bought you to a dark place to begin with. I prefer dexamphetamine. Methamphetamine, while stronger, is illegal and thus one cannot guarantee purity, what cutting agents have been used and how other people have reacted to the same batch. ATS like Ritalin (methylphenidate) and Duromine (phentermine) are also effective, albeit the come-down can be remarkably unpleasant. Upon being prescribed methylphenidate by my psychiatrist at the age of 19, I quickly discovered combining it with alcohol (ethanol) produces a beautiful sense of euphoria, and practically obliterates negative thoughts about past, present and future. When combined with ethanol, methylphenidate becomes ethylphenidate, and the sense of euphoria it generates is second-to-none.
So yeah, basically my experiences have taught me stimulants provide the most effective way to induce voluntary memory impairment. On the other hand, opiates, benzodiazepines and alcohol allow the brain to explore the emotions which are causing the grief and pain.
Generally speaking, the best way to minimising psychological suffering with psychoactive drugs is through trial-and-error. And, naturally, everybody's genetic makeup, socio-economic background, up-bringing and so forth vary greatly from person-to-person, and thus any "one size fits all" approach is quickly rendered obsolete.
I hope this post has helped somewhat, and to all those suffering, for whatever reason, stay strong and never, never give up.