I just randomly came across a video on YouTube that explains that one of my meds increases the risk of dementia and cognitive decline. I cannot believe I was prescribed this when there are alternatives without that issue.
Sometimes doctors slip up and make bad choices. Prescribing can be tricky though, and the drug you're being prescribed might not necessarily be so bad overall. It's pretty common for drugs to have a set of trade offs where there are some negative side effects and risks as well as benefits, with those risks and benefits not necessarily being evenly distributed across all patients. If you get into the weeds, it could be that the dementia and cognitive decline risk is chiefly for the elderly but slim or non-existent for your age group.
It's also possible that you didn't really come across this video randomly, but rather that data that has been collected about you was used to feed you this video. There might be an unethical drug company that is bad mouthing this drug in order to persuade you to buy their drug.
So for example, I've tried doing searches on youtube for "causes of the opioid epidemic", and end up getting at least some videos that still push the (discredited) notion that it's only people with a history of drug abuse that are at risk for developing dependency, and which generally promote opioid prescription. The videos are never labeled as being produced by drug companies, but there is certainly reason to be suspicious.
Drug companies know that if patients go to their doctors and say "I want drug y", there is a good chance that doctors will prescribe it without defending other choices that might actually be better. I think it would be ok to ask your doctor about this, but it might be better to ask "what are the advantages and disadvantages of the drug I'm getting versus alternatives" rather than asking for a particular drug.