Lets do dog on dog first....
There is no "best way". Usually after all the snarling n commotion, one or both dogs will "lock" onto eachother somewhere. To most dogs, especially pitbulls, its viewed as a challenge to them. So the dog with the most drive n dedication to the "challenge" is gonna win, or in this situation, do the most damage. Because pitts were bred for centuries to withstand quitting from pain, usually pitts will simply hold on tighter and longer. To them, giving up, even if theyre in extreme pain, just isnt an option. Its just their drive n determination.
So, what you wanna do is keep them as still as possible. Its the "shaking" once locked on that does the most damage. If theyre kept pretty still, all theyre doin is clenching flesh. Ill take simple puncture holes over a torn open throat anyday. So keep em as still as possible. Next, theres a few ways....
Pepper spray- works great. Theyll release almost immediately.
Finger up the butt- as gross as it seems, it works great.
Breaking stick- no not break it over a dogs head. Its a very strong stick, that comes to a wedge at one end, similar to a flathead screwdriver. Get it wedged between the REAR teeth if possible, and pry em open.
Water- if youre carryin a water bottle, or any liquid for that matter, soda, juice, etc.... pour it in/down the dogs throat AND snout. They think theyre under water/drowning, and survival instinct takes over. Theyll release to get air.
Cover the snout/nose- sometimes, not all, if you can seal up the nasal airway it has a similar effect as pouring water down their throat.
Lighter- if youre a smoker, take your lighter and put the flame straight to their nose. Theyll release.
Use anything violence related as a last resort honestly. A lot of breeds, not just a pitbull, go into superman mode in those situations. Your punches and kicks will only make the situation worse, not better.
Ok, now, dog on human....
If you cant outrun the fucker or get to higher ground quick enough, try this....
Most dogs jump to attack a human, especially adults obviously. Right as they jump, try to time it to where you can grip the neck/scruff right behind the lower jaw bones. Hold on tight and do not let go. Its almost like grippin a poisonous snake right behind the head to keep safe from strikes. DO NOT ATTEMPT A HEADLOCK. Its too easy for a strong dog to get loose, and usually your head/face is in very close proximity.
Another defense is pretend youre playing flag football. Everytime those jaws get close and are about to chomp down, spin like youre protecting your flags or like your a ballerina. Not multiple spins, just one very quick spin while stepping away from the dog. It makes it very hard for them to grip down. And if your hands are quick enough, push them away at the same time.
Stay moving, but DO NOT BACK PEDAL. If you start back pedalling and the dog jumps for an attack, youre almost gauranteed to fall, and once you fall, its over with.
Hold the dog. Lets say the dog lunges and locks onto your arm. As long as your arm is in his mouth, his teeth are tied up n cant bite anywhere else. If your forearm is in his mouth, try n get him in a reverse choke hold, with your arm still in his mouth, and squeeze/bear hug that motherfucker to keep him as still as possible so its not "shaking". Its not a great solution, but again, ill take punctures over tears any day.
And last..... fight for your life. Punch, kick, grab a rock or something else handy, somethin. Might not do much, but its better than giving up.
Thats my advice in those situations. I understand some might say to just stand as still as possible and hopefully the dog will lose interest, however, ive never seen it work out for the individual. So, thats your choice.
Hope this helps at all.