Hey!
first of all, I'm sorry to hear this but I can totally relate to this thing. A few months, my puppy was doing the same thing too. She used to pee normally and then blood used to come out. I took her to the vet and we found out that it was blood infection. We started giving her pills and after 4-6 doses, she started recovering well.
So don't worry, I can understand what you are going through, just comfort your dog and take him or her to vet