Medication-assisted treatment is sometimes used during the initial detox phase to help lessen the adverse side effects of withdrawals. Doctors can also prescribe medication during treatment as a way of helping prevent relapse, and this medication may become part of a patient’s long-term treatment plan.