Addiction is a disorder that can be characterized in part as the constant pursuit of a particular substance despite negative consequences. Although the orbitofrontal cortex (OFC) is known to regulate risk-taking more generally and be critical to the development of addiction, its role in regulating drug use under risk-taking conditions is unknown. To address this, we examined drug-taking and drug-seeking in male and female rats under conditions where cocaine infusions were paired with foot shock punishment 50% of the time and combined this paradigm with cFos immunohistochemistry. We found that rats that showed higher levels of drug-taking and drug-seeking prior to punishment showed decreased responding during self-administration sessions under risky conditions and lower levels of c-Fos expression in the lateral but not medial OFC. However, despite these initial differences in responses to infusions paired with foot shocks, all rats showed decreased responding with additional punishment sessions. We then used chemogenetic viral approaches to examine how altering activity of the lateral OFC affects drug-taking and drug-seeking during punished drug use. Although there was no effect of G i/o DREADD-mediated inhibition of the lateral OFC on these behaviors, G q DREADD-mediated activation increased drug-taking and drug-seeking when drug use was associated with foot shock 50% of the time. Interestingly, this manipulation had no effect on non-risky self-administration behavior. These results suggest that the involvement of lateral OFC in cocaine use is context-sensitive and influences decision-making based on negative outcomes.