Can I take my first Bc pill as a soon after a miscarriage?

The doctor said to take it right away. But my gynecologist told me to wait for my period but how could I if I’m still bleeding my uterus lining. And I’m confused. Please help. And will this lower the affect of my meds. Like Xanax and ambien