Detox can be a painful process because your brain has to relearn how to function without the presence of fentanyl. This can cause physical pain and severe depression, anxiety, and other mental symptoms. Detoxing at a rehab center can reduce this discomfort with medication-assisted treatment, one-on-one therapy, and group therapy.