CBT is used to treat cocaine addiction by helping patients learn new behaviors to stop cocaine abuse. Key principles of CBT include modeling new behaviors, operant conditioning to understand triggers of use and develop alternative reinforcers to cocaine, and classical conditioning to reduce cravings by extinguishing conditioned cues. Treatment is individualized and focuses on teaching patients skills like coping with cravings and managing thoughts to initially gain control over cocaine use and achieve abstinence.