If you are robbed and your life doesn't directly and absolutely depend on the items/money that are stolen for you, BEHAVE AND GIVE THEM.
YOU FIGHT ONLY FOR YOUR LIFE. You don't know if they have knifes, guns. Give the money, give the items. Your life is much more important.
If you see a knife you run! In a knife fight you will get cut. The chances of survival are very slim.
Do not learn self defending techniques on the internet. 99% of what is on the internet is bullshit and will get you killed.
Violence is quick and brutal. Even if you have reflexes, good judgment you will still get hurt and you don't know many things.
For the select people who train and learn real self defense, you know to smell the attacker and the risk of your life. It is a sense developed and you know.
Also do not give in to the stupid thought that you are not a man or whatever bullshit in case of boys, if you do not fight or try to calm the situation.
You have to engrave in your mind a capacity of survival. That means to de escalate, to survive. That means, if you ever fight, you have to fight for your life, and that means you do not stop and it is an unalterable action of defense which can result in loss of life.
You also need to not be so sensitive but also not so much desensitized. There's a healthy balance of rational decision but also of irrational adrenaline reaction. In any case you have to justify fully such actions to only be of defensive nature that is absolutely necessary.
Having all of this said, this is not legal advice and neither incentive to violence but personal observation or reality. Learn your local law, learn to fight, learn diplomacy, learn to speak. Learn when to be stupid, when to be smart.