Best thing to do IMO is not to wait for them to try and get one on you, but to strike first. Chances are most muggers will confront their wouldbe victim and demand whatever it is they are after, try and intimidate before actually using violence, although there are plenty of exceptions.
Once I know that shit is going to hit the fan, I make sure I'm the one to turn the fan on. Hit hard, fast, preferably to a pressure point, and for example, stamp on a knee, ankle or ribcage when they go down. Clapping both hands over an attacker's ears is an excellent defensive technique and will most likely knock an assailant unconscious.
Most street thugs tend to go straight for a roundhouse punch, your average brawler isn't particularly skilled, just aggressive, mean and intimidating, and most likely, also very stupid. Its easy as hell to block or
under a roundhouse punch, and reply with E.g an elbow to the solar plexus and a back-hand or hammer-fisted strike to the groin.
If you get 'em down, follow it up quickly and viciously. Don't stop to think 'hey, am I being fair, or am I doing the right thing here?', the time it takes to start wondering about that is the same time it takes some drunken shit for brains guttersnipe to rip your head off and shit down your neck.
Stay just a little out of the range of any assailant, make THEM come to YOU, if they have to come forward to get to you, the distance you put between shithead and you gives you the opportunity to counter whatever they try.
Don't aim kicks above waist height unless you know what you are doing, and if you can help it, don't punch with knuckles to most areas, its too easy to break something or injure yourself. I've done it myself, after cracking a thug in the temple, I cracked a bone in my wrist, had to have it splinted for a while, and it hurt like hell.
Some of the most effective techniques aren't the flashy sporting martial arts moves intended for competing, and demonstration. But are simple yet effective strikes. Uppercuts to the jaw, hands clapped over both ears, knee to the common peroneal nerve that runs just above and outwards from the kneecap (or is that the peroneal nerve...one runs in a similar position on the inside, and one on the outside)
The brachial plexus is also pretty vulnerable, located at the base of the neck, just about where it meets the shoulder, at the back. Best way to hit it is with the side edge of the heel of the hand, or if you can get the assailant down low, an elbow to the brachial plexus will almost certainly stun the assailant pretty badly. Other good places are a back fisted strike to the 'funny bone', which can make an attacker drop a knife if there is no opportunity to run. The brachial strike will also numb the affected arm, if it doesn't drop the bugger completely. As will blocking that typical roundhouse punch they usually try, forcing the arm up, and ramming the end of a bottle up into the armpit, or an elbow if no bottle is available.
And try to use an assailant's own weight and momentum against them. even a big, heavy brute will go down if you get one leg behind theirs, and push/twist while gripping their arm/clothing.
All in all, its better to leg it if you can, unless there is somebody vulnerable with you, abandoning one's friends is cowardice of the most unforgivable kind. As for me. I can't run much, not effectively. I'd get gripped pretty quickly by most any wouldbe mugger, walking is bad enough if I haven't had my oxy recently. Oh boy...going to the doctors was absolute hell today. They open at half 8 in the morning, and the phone lines are always jammed by a maximum of 30 seconds after that. Only way to reliably get an appointment is to sprint there to the door before they open and que up.
Was I ever hurting after that! and to top it off, there was only one doctor in, and the nurses, my main doc was on holiday, the guy that runs the practice, the autistic-hating bitch woman that always tells me to go get a job, or did until I put in a complaint against her, the one that has cut me off my regular scripts randomly before, that cow was off, and another I sometimes see, who is ok but none too bright was off sick.
So they were only seeing emergency cases. Lucky I managed to convince them that not having enough pain meds fell under that description, but was I ever hurting for running there. I was damn lucky to get an appointment even arriving early before they opened, and jumping the que a bit, under the excuse of getting out of the weather to take shelter in between the two entrance doors.
Thankfully the area right where I live isn't too bad for thugs. Although there are some rough areas around here, there have been a few stabbings. A 13-14yo kid got shanked in the liver, by some dirtbag after refusing to hide some stolen lead roofing for said dirtbag. Arsewipe burst into the house the kid was staying at with my friend's brother, and stabbed him, narrowly missing a major blood vessel. He picked the wrong family to mess with though, and AFAIK bad things happened to him after he got released from prison. Some other guy got stabbed in the back randomly on another estate where a friend of mine lives (not a scumbag, shes a decent lass, aspie I'm pretty sure)