In Season 2 episode 14, Reid is kidnapped by an unsub with Dissociative Identity Disorder. The story continues in episode 15 where Reid is injected multiple times with a combination of Dilaudid (drug store heroine) and a psychidelic which causes the flashbacks. At the end of the episode, he shoots the unsub and takes the drugs from his pocket. In episodes 16 and 17, we can see that Reid is suffering from Post Traumatic Stress Disorder as he goes in and out of flashbacks about his kidnapping. He is also seen in the bathroom of a police station pulling the drugs from his bag debating whether to take them before Hotch calls out his name. In episode 18, Reid meets up with an old friend from his childhood, who points out that he can tell that something is not right with Reid, despite that Reid says he is okay. At the end of this episode, Gideon finds Reid in an upscale bar and Reid confesses that he is struggling, but Gideon tells him that "anybody whose been through what you've been through recently, would." This is the the turning point for Reid in which he decides he needs to quit taking drugs, although there are still references to his drug use in other episodes (Season 2 episode 19, Season 2 Finale, Season 3 episode 2, and Season 3 episodes 15 and 16.) Hope this helps.