Basic defensive preparedness matters: Check your ego. Avoid trouble. De-escalate if possible. If danger cannot be otherwise avoided, do what is needed to stop the threat cold.
That said, practice with what you carry. That can be tricky with knives since you need something comparable to stand in as a trainer. You have to balance effectiveness with safety while training against active resistance. That means being able to effectively get it out and use it properly while a friend (or instructor) is actively applying force, trying to get you, etc. Real-life defensive encounters are not nice or orderly. They often involve things like someone strong violently manhandling you, savagely swinging, trying to stab you, etc.; or an aggressive animal biting and clawing with everything they've got.