Have you had a cold recently? Or do you still have a cold?
It's very normal for some blood to be in your mucus when you cough during a cold virus.
Just like it's normal for some blood to be in your snot when you blow your nose.
If it's just a little blood and it clears up in a few days then I wouldn't be too concerned.
If you're coughing up a lot of blood then you might want to go to the doctor or get to the emergency room asap as it could be something serious.