Self-defense is one of the potential defenses to an assault charge. Someone may accuse you of assaulting them, but you may claim that they actually threw the first punch and you were just protecting yourself.
One thing to keep in mind is that a proportional response is typically required for you to effectively claim that you were just defending yourself. You cannot excessively escalate the situation and still make that claim.
For instance, if you get angry at someone in traffic and they slap you in the face during the disagreement, you typically cannot pull out a gun and shoot them. You may be able to defend yourself from the physical assault, but not to the extent that you cause far more harm than necessary.
To use that level of force — referred to as “deadly force” — you generally have to fear for your own life. You can then respond and defend yourself in kind. For instance, if that person slaps you and then pulls out a gun of their own, self-defense with a firearm may be justified.
In essence, you just want to keep the level of physicality between the two of you as equal as you can. Do not introduce any weapons into the fight if none are used against you. Do not use deadly force unless you believe your own life is in danger. Take appropriate action to keep yourself safe without unnecessarily harming someone else.
When you do these things, self-defense may be a valid way to approach an assault charge. Make sure you fully understand all of the legal options at your disposal.