I have no idea what has come out of me

So I haven’t had my period for 3 months and I finally got it after 2 days of black spotting

Then this morning I woke up and this has fallen out

I’m really scared and unsure of if I should go to the doctors