Can I take the prescription medication Vitamin d-2 cap 50,000 IU?

There is a difference between consuming a medicine where one does not benefit from the taste and where one does benefit from the taste (like a a flavored syrup medicine).

One should ensure that all non medically urgent pain relievers are kosher. You can look up the specific medicine by following some of the following links by way of example:

https://www.star-k.org/resource_list.php?list=RR8I4NNG&title=Pain Relievers

http://www.crcweb.org/OTCMedicineReport.pdf