Cocaine is an illegal narcotic that is produced in the leaves of the coca plant and affects the central nervous system. This sensory stimulation effect is what makes the drug highly addictive. Chemically, its name is benzoylmethylecgonine and the structure is shown below. Because of the nitrogen amine present in the chemical compound, cocaine is most commonly found as the hydrochloride salt. This makes the most common form of the drug a fine white powder that is often nasally inhaled. The salt form is highly water soluble, so aqueous solutions of it can be made for topical use or intravenous injection. The other major form of cocaine is colloquially called crack cocaine. It is usually a crude, hard solid lump that is usually heated with a flame to produce a smoke that is inhaled. This form of the drug is not a hydrochloride salt but the free amine base, so this method of smoking is sometimes referred to as "freebasing."
Amphetamines are a class of chemicals that also act as central nervous system stimulants, are addictive, and are illegal narcotics. The chemical name is alpha-methylphenethylamine and the structure is shown below. The term "amphetamines" generally refers to an entire family of molecules with this structure as the core, often incorporating different chemical groups on the nitrogen atom and their various salt forms. Perhaps the most common member of the amphetamine family is methamphetamine, colloquially referred to as "meth" or "crystal meth" in its hydrochloride salt form and the basis for the popular television show Breaking Bad. Some amphetamines are still used as prescription drugs and this class of drugs is sometimes (illegally) used by athletes for performance enhancing purposes.
In terms of treatment, the ultimate treatment of both drugs is to simply stop using them and break the cycle of addiction. This is, of course, easier said than done. Using pharmacological substances (legal prescription drugs) to help treat the addiction and the side effects of breaking an addiction can help with the initial treatment. But most experts agree that some type of long term mental counseling and an emotional support group are absolutely necessary in order to become drug free and maintain a substance free lifestyle. Live-in rehabilitation centers and 12 step methods and counseling groups are popular methods of treatment.