Make sure you look at your surrounds when someone approaches you. Look at feet and hand placement of your opponent. Dont alarm your attacker by making sudden quick moves unless its in the act of disarming them at that moment. Letting your attacker know you are ready to fight them, takes away the element of surprise. The element of surprise is a huge factor when it comes to someone wanting something from you. They assume you are going to comply since they have the upper hand (weapon) but a trained martial arts is the true weapon to situations like these. Use whatever it is they want as a way of misdirection away from your leading hand. Throw the object to there face is possible to give you a split second of a upper hand. Redirect the weapon as far away from your body and others as much as possible. Control the wrist of the attacker of which the weapon is being held. You can follow up with certain arm breaks or attacks of your own.
If you know your attacker and they are going to kill you then its time to wrap your shirt around your hand and use it lessen the chances of you getting cut. Since you both know you are going to fight its ok to let the attacker know, you are not going down without a fight. In real life situation dont tip off your attacker with retaliation as this will only give you higher chances of being injured. You have to practice for many years to perfect a art, so practice and after you do that practice some more 🙂