Many medications can make someone constipate. Medications like antidepressants, anticholinergic, opioid, calcium channel blockers and many others can cause constipation.
The best way to treat this type of constipation is to increase your fiber intake, eat more of legumes and vegetables. You can also get fiber supplements like methylcellulose and psullium.
If the constipation is becoming severe, you can ask your health care provider to change that particular medicine to any other one that would not cause constipation.