Is this a miscarriage?

I woke up in the middle of the night with a lot of cramping and my bed stained with blood. Today in the morning I went to the restroom and felt this come out. I didn’t know I was pregnant or Idk if I am. Can someone tell me if this was a miscarriage?