What has just come out of me?

Okay so two/three days ago I had really bad pains. They weren’t like period pains they were more sharp pains. I also had really thick goopy mucus come out of me which was very clearly not normal. To the point where I thought I had an STI because of the above.

Then today I started bleeding (light) brown blood and this came out of me when I was on the toilet. I have had blood clots before and I have endometriosis so I REALLY know what clots look like. This just is weird to me. It was black and firm. I tried pressing it n it stayed in tacked.

Does anyone have an idea of what this is? Obviously the first thing that comes to mind is a miscarriage, and if so I wasn’t aware I was pregnant. I think I’m going to go to the doctors tomorrow but I don’t know if I’m just being dramatic?

UPDATE:

It’s a staph infection and antibiotics aren’t working (I’ve had three different lots). I have blood tests next week and have had another swab taken, also have been referred back to the gynaecologist. Will update when I know more