The process of doing that is called detoxification. It does not necessarily remove all drugs in your system, but it helps reduce the drugs' effect to the body and enhance the elimination of its metabolites. There is no effective method that totally removes all drug compounds in the body, contrary to the claims of alternative medicine's "detox" programs. Here is a link about detoxification: http://www.ask.com/wiki/Detoxification
If you wish to clean your system of drug residues then you have to exercise and drink lots of water so it will naturally exit your body through sweat and urine. Eating fiber rich foods will also be beneficial because it can help flush the drug substances through your feces.