You could do an anonymous tip, but if the police raid the apartment you could get swept up in the raid and charged criminally. It may be better to report it but not anonymously so it is clear you have no rolle in the drug dealing. You could also ask the roommate to move out or move out yourself. If the roommate refuses, you could report him to the landlord and ask them to evict him.
Moving out is the best action to separate yourself from the criminal activity. You can make an anonymous tip, but when action is taken by the police you may get caught in the middle of everything. You may consider becoming a confidential informant for the police and seek an agreement not to be prosecuted for your cooperation. This may be done best by having an attorney contact the police to discuss the matter so you do not have to be identified at first. Your roommate will eventually learn of your involvement, so you should be prepared for that.
DISCLAIMER: This answer is provided in response to a "hypothetical" question and provided for general, informational purposes and does not create an attorney/client relationship. The information presented is not legal advice and may change based additional information and research. It is recommended that you speak to an attorney to discuss your specific legal issues.