The November/December 2020 issue of Police & Security News has a good article by Ralph Mroz on knife defense, "Everything You Need To Know About Empty Hands Knife Defense." He begins the article by noting the time/reaction problem: someone with a knife can move 21 feet in less time that it would take most trained people to draw and fire a weapon. (And, I would add, there is no guarantee that even if you got off one shot it would stop the attacker). This is further compounded by the fact that you may not even see the knife until the moment of attack. There was a video I linked to sometime in the last couple months that showed an officer that stopped someone, and the person kept their left side and arm out of view of the officer until the officer started to turn the person to cuff them and the person then attacked with a knife.
If that were not enough, most of the techniques taught on how to defend against a knife attack are severely deficient. I know that the techniques I learned long ago would likely end up with me dead even if I was fully aware and expecting a knife attack. In any event, Mroz notes that a defense requires that you stop the knife arm with both of your arms/hands, and use the pause in action to disable your attacker some other way. He recommends that you get a rubber knife and practice.
I have practiced with a dummy knife with someone trying an attack. Overhand stabbing attacks are the easiest to defend against because it involves movements that you probably learned in your earliest karate or Taekwondo classes. Horizontal slashes or mid- or low-level stabbing attacks are more difficult. Like almost any other attack, you have to get off the X while grabbing the arm with the knife. In practice with my oldest son, it seemed that grabbing the wrist with the same hand as the side the knife is coming from (i.e., if the attack was from the attacker's right side, you would want to use your right hand) and then grabbing their arm (or gripping the fabric of a coat sleeve or shirt sleeve) just above that with your other hand seemed to work best in our practice.
Anyway, it is useful article. Mroz links to some videos: "Surviving Edged Weapons" and a couple examples of deficient techniques. Read the whole thing.
And while we are on the topic, Greg Elifritz posted an article earlier this week looking at some of what he considers to be the best law enforcement fixed blade knives, including recommendations as to where and how to carry them.