Do not scratch the inside of your nose too much, or you will make it bleed.
If you use nasal spray like Afrin or Neo-Synephrine when you get a nosebleed, it helps shrink the blood vessels in your nose and makes it easier to control the bleeding with direct pressure by pinching your nose closed. You can also saturate a cotton swab with the nasal spray and place it in your nose, then pinch it closed, so the liquid spreads and covers the relevant area, assuming it's bleeding near the front, which it ususally would be if the nosebleed was from scratching your nose.
If this doesn't stop the bleeding, sometimes you can get the leaky blood vessel cauterized at urgent care with silver nitrate, although they can't use that unless they can stop the bleeding and it's just from a single place. If they can't or if it's bleeding from multiple places like mine did recently, they can try packing the bleeding nostril with gauze saturated with something, I'm not sure what, but I think it might have been Vaseline. If your nose is bleeding too far back for that to stop it, which mine was recently, you can go to the emergency room and they can use epinephrine to try to stop the bleeding, then they can numb your nose and place a sort of balloon into it and inflate it. Then they leave the balloon in place for a few days and tape the tail to your cheek. It's extremely unpleasant to have that balloon up your nose for days because it blocks your tear duct and your sinuses, but at least they give you an antibiotic to prevent a sinus infection and it's better than bleeding uncontrollably.
I was taking baby aspirin to prevent blood clots in my leg because I had surgery on my knee recently and that made my nose bleed for twelve hours before they were able to stop it. Apparently, my platelets are very sensitive to aspirin.