You do need to get checked out just in case but my proffessional opinion as a nurse wthout seeing you is that coughing has caused a tiny cut in your oesophagus or windpipe. As Ethel said what is this blood like? If it is bright, hence fresh, it is probably as I said.
Neverleave anything to chance though and please get it checked out.